From 7a7f366eb185d28c88617d742b2c7511e62f9ffd Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 24 Apr 2020 19:05:17 -0400 Subject: [PATCH] Change semantics of zm_send_packetreceive_frame to return the # of bytes consumed. This is inline with how to old deprecated api used to work. The new api consumes the packet, so just return packet size. --- src/zm_ffmpeg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zm_ffmpeg.cpp b/src/zm_ffmpeg.cpp index f0b3dc76e..1631749fb 100644 --- a/src/zm_ffmpeg.cpp +++ b/src/zm_ffmpeg.cpp @@ -559,6 +559,8 @@ int zm_send_packet_receive_frame( } return ret; } + // In this api the packet is always consumed, so return packet.bytes + return packet.size; # else int frameComplete = 0; while ( !frameComplete ) { @@ -572,8 +574,8 @@ int zm_send_packet_receive_frame( return ret; } } // end while !frameComplete + return ret; #endif - return 0; } // end int zm_send_packet_receive_frame(AVCodecContext *context, AVFrame *frame, AVPacket &packet) /* Returns < 0 on error, 0 if codec not ready, 1 on success