[FFmpeg-devel] [PATCH 1/3] ffmpeg: check ost->finished in reap_filters()

Michael Niedermayer michaelni at gmx.at
Tue Jan 14 04:40:39 CET 2014


This avoids finished output streams continuing to receive frames

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 5ccbf10..e2424ad 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1093,6 +1093,10 @@ static int reap_filters(void)
                 }
                 break;
             }
+            if (ost->finished) {
+                av_frame_unref(filtered_frame);
+                continue;
+            }
             frame_pts = AV_NOPTS_VALUE;
             if (filtered_frame->pts != AV_NOPTS_VALUE) {
                 int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list