[FFmpeg-cvslog] ffmpeg: probe buffersinks once more after EOF.

Nicolas George git at videolan.org
Fri Jul 20 10:36:25 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Tue Jul 17 18:02:33 2012 +0200| [bf8ce5a5c382e85f6e7c0bb9d5e698a4c929b0b9] | committer: Nicolas George

ffmpeg: probe buffersinks once more after EOF.

Reap buffers stored in the buffer sinks even when
the avfilter_graph_request_oldest() loop only returns EOF.

avfilter_graph_request_oldest() can cause frames to arrive
to the sinks even when it returns EOF.

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

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

diff --git a/ffmpeg.c b/ffmpeg.c
index 9ef2b57..93e3f04 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1928,7 +1928,7 @@ static int poll_filters(void)
     AVFilterBufferRef *picref;
     AVFrame *filtered_frame = NULL;
     int i, ret, ret_all;
-    unsigned nb_success, nb_eof;
+    unsigned nb_success = 1, av_uninit(nb_eof);
     int64_t frame_pts;
 
     while (1) {
@@ -2001,6 +2001,8 @@ static int poll_filters(void)
                 avfilter_unref_buffer(picref);
             }
         }
+        if (!nb_success) /* from last round */
+            break;
         /* Request frames through all the graphs */
         ret_all = nb_success = nb_eof = 0;
         for (i = 0; i < nb_filtergraphs; i++) {
@@ -2017,8 +2019,6 @@ static int poll_filters(void)
                 ret_all = ret;
             }
         }
-        if (!nb_success)
-            break;
         /* Try again if anything succeeded */
     }
     return nb_eof == nb_filtergraphs ? AVERROR_EOF : ret_all;



More information about the ffmpeg-cvslog mailing list