]> git.sesse.net Git - ffmpeg/commitdiff
lavfi: avfilter_graph_request_oldest: request a frame again before returning.
authorNicolas George <george@nsup.org>
Fri, 23 Dec 2016 10:18:09 +0000 (11:18 +0100)
committerNicolas George <george@nsup.org>
Fri, 23 Dec 2016 14:21:43 +0000 (15:21 +0100)
With min_samples, if a frame arrives but is too small, it clears
frame_wanted_out. In most cases, the destination filter would be
activated again later because of frame_wanted_out on its own
outputs, but not sinks.
avfilter_graph_request_oldest() is doing the work of the sink
itself, and is therefore allowed to use frame_blocked_in.

libavfilter/avfiltergraph.c

index 6b5a6f34ec91cfc87205caa56dd5b13660d284ce..cb5d618ab1b45a364a8ad532c7bae07e9780a1e2 100644 (file)
@@ -1407,7 +1407,11 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph)
     frame_count = oldest->frame_count_out;
     while (frame_count == oldest->frame_count_out) {
         r = ff_filter_graph_run_once(graph);
-        if (r < 0)
+        if (r == AVERROR(EAGAIN) &&
+            !oldest->frame_wanted_out && !oldest->frame_blocked_in &&
+            !oldest->status_in)
+            ff_request_frame(oldest);
+        else if (r < 0)
             return r;
     }
     return 0;