]> git.sesse.net Git - ffmpeg/commitdiff
lavfi: fix filter format negotiation loop.
authorNicolas George <nicolas.george@normalesup.org>
Mon, 6 May 2013 11:46:23 +0000 (13:46 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Tue, 7 May 2013 16:40:51 +0000 (18:40 +0200)
query_formats() returning EAGAIN is not considered a progress
in the format negotiation.

If the filter returns EAGAIN but did set some of its formats
lists, it could be considered a partial success and counted
as progress in the negotiation. Not counting it is not a
problem because it currently only happens in the first round,
where there will always be some progress on the other filters.

libavfilter/avfiltergraph.c

index 582a87023d858406615b2dc10b14bff31477cf91..860f1d892b64298ab4436beadaf4d242495f9dc6 100644 (file)
@@ -333,7 +333,8 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
             ret = ff_default_query_formats(f);
         if (ret < 0 && ret != AVERROR(EAGAIN))
             return ret;
-        count_queried++;
+        /* note: EAGAIN could indicate a partial success, not counted yet */
+        count_queried += ret >= 0;
     }
 
     /* go through and merge as many format lists as possible */