From 6a87d9a8759db2954750c3d13468cd5a09235163 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 25 Jun 2019 15:32:47 -0400 Subject: [PATCH] change zm_receive_frame to return AVERROR instead of boolean --- src/zm_ffmpeg.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index b701e79bc..029492f90 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -511,12 +511,13 @@ int zm_receive_frame(AVCodecContext *context, AVFrame *frame, AVPacket &packet) if ( (ret = avcodec_send_packet(context, &packet)) < 0 ) { Error( "Unable to send packet %s, continuing", av_make_error_string(ret).c_str() ); - return 0; + return ret; } if ( (ret = avcodec_receive_frame(context, frame)) < 0 ) { - Error( "Unable to send packet %s, continuing", av_make_error_string(ret).c_str() ); - return 0; + Error("Unable to send packet %s, continuing", + av_make_error_string(ret).c_str()); + return ret; } # else int frameComplete = 0; @@ -528,11 +529,11 @@ int zm_receive_frame(AVCodecContext *context, AVFrame *frame, AVPacket &packet) } if ( ret < 0 ) { Error("Unable to decode frame: %s", av_make_error_string(ret).c_str()); - return 0; + return ret; } } // end while !frameComplete #endif - return 1; + return 0; } // end int zm_receive_frame(AVCodecContext *context, AVFrame *frame, AVPacket &packet) void dumpPacket(AVStream *stream, AVPacket *pkt, const char *text) {