[FFmpeg-devel] [PATCH 4/5] ffmpeg/flush_encoders: dont mux packets once ost->finished has been set

Michael Niedermayer michaelni at gmx.at
Wed Jan 15 17:58:46 CET 2014


Fixes muxing frames after av_interleaved_write_frame() failure

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 ffmpeg.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 043061b..851f643 100644
--- 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)
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list