ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Sat Nov  5 00:04:27 
2016 -0300| [55061bbc558e22db04a40e4efed46d9c15b124b6] | committer: James Almer

ffmpeg: don't overwrite av_bsf_receive_packet return value before checking it

Reviewed-by: Michael Niedermayer <mich...@niedermayer.cc>
Signed-off-by: James Almer <jamr...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55061bbc558e22db04a40e4efed46d9c15b124b6
---

 ffmpeg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 28daf5f..067ef1d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -800,6 +800,12 @@ static void output_packet(OutputFile *of, AVPacket *pkt, 
OutputStream *ost)
         while (idx) {
             /* get a packet from the previous filter up the chain */
             ret = av_bsf_receive_packet(ost->bsf_ctx[idx - 1], pkt);
+            if (ret == AVERROR(EAGAIN)) {
+                ret = 0;
+                idx--;
+                continue;
+            } else if (ret < 0)
+                goto finish;
             /* HACK! - aac_adtstoasc updates extradata after filtering the 
first frame when
              * the api states this shouldn't happen after init(). Propagate it 
here to the
              * muxer and to the next filters in the chain to workaround this.
@@ -811,12 +817,6 @@ static void output_packet(OutputFile *of, AVPacket *pkt, 
OutputStream *ost)
                     goto finish;
                 ost->bsf_extradata_updated[idx - 1] |= 1;
             }
-            if (ret == AVERROR(EAGAIN)) {
-                ret = 0;
-                idx--;
-                continue;
-            } else if (ret < 0)
-                goto finish;
 
             /* send it to the next filter down the chain or to the muxer */
             if (idx < ost->nb_bitstream_filters) {

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to