[FFmpeg-cvslog] lavfi/avfiltergraph: only return EOF in avfilter_graph_request_oldest if all sinks EOFed

Marton Balint git at videolan.org
Sun May 7 20:48:23 EEST 2017


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat May  6 01:12:24 2017 +0200| [c0443c1af1a772daf33731da7262f3aa6b28dc8e] | committer: Marton Balint

lavfi/avfiltergraph: only return EOF in avfilter_graph_request_oldest if all sinks EOFed

Fixes a regression introduced in 32c59a115d3cc757676b5384a5ea44b5a7a7b872,
becoming effective in 912969a33e313c57c906e87a7e2367b78a2160f4.

Fixes trimmed output of
ffmpeg -f lavfi -i "sine=d=0.01" -f lavfi -i "sine=d=1" -filter_complex "[0:a]anull[a1];[1:a]anull[a2]" -map "[a1]" -f null none -map "[a2]" -f framecrc -

Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavfilter/avfiltergraph.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index f7fbf119eb..598e50a077 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -1399,10 +1399,13 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph)
         oldest = graph->sink_links[0];
         if (oldest->dst->filter->activate) {
             /* For now, buffersink is the only filter implementing activate. */
-            return av_buffersink_get_frame_flags(oldest->dst, NULL,
-                                                 AV_BUFFERSINK_FLAG_PEEK);
+            r = av_buffersink_get_frame_flags(oldest->dst, NULL,
+                                              AV_BUFFERSINK_FLAG_PEEK);
+            if (r != AVERROR_EOF)
+                return r;
+        } else {
+            r = ff_request_frame(oldest);
         }
-        r = ff_request_frame(oldest);
         if (r != AVERROR_EOF)
             break;
         av_log(oldest->dst, AV_LOG_DEBUG, "EOF on sink link %s:%s.\n",



More information about the ffmpeg-cvslog mailing list