From 6925a7583117a29cdc65c02b3c78879c90e157b4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 15 Sep 2019 18:01:38 -0400 Subject: [PATCH] codec not ready is not an error. Make it a debug --- src/zm_ffmpeg.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index 81506cad2..339b54c6c 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -547,8 +547,14 @@ int zm_send_packet_receive_frame( } if ( (ret = avcodec_receive_frame(context, frame)) < 0 ) { - Error("Unable to send packet %s, continuing", - av_make_error_string(ret).c_str()); + if ( AVERROR(EAGAIN) == ret ) { + // The codec may need more samples than it has, perfectly valid + Debug(2, "Codec not ready to give us a frame"); + return 0; + } else { + Error("Could not recieve frame (error %d = '%s')", ret, + av_make_error_string(ret).c_str()); + } return ret; } # else