ffmpeg/flush_encoders: dont mux packets once ost->finished has been set
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Jan 2014 16:07:26 +0000 (17:07 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 17 Jan 2014 22:47:38 +0000 (23:47 +0100)
Fixes muxing frames after av_interleaved_write_frame() failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index f4aa975..6b90878 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1389,6 +1389,10 @@ static void flush_encoders(void)
                     stop_encoding = 1;
                     break;
                 }
+                if (ost->finished > 1) {
+                    av_free_packet(&pkt);
+                    continue;
+                }
                 if (pkt.pts != AV_NOPTS_VALUE)
                     pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
                 if (pkt.dts != AV_NOPTS_VALUE)