[FFmpeg-devel] [PATCH 1/2] lavfi: fix filter format negotiation loop.

Paul B Mahol onemda at gmail.com
Tue May 7 18:20:44 CEST 2013


On 5/6/13, Nicolas George <nicolas.george at normalesup.org> wrote:
> 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.
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/avfiltergraph.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index 582a870..860f1d8 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -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 */
> --
> 1.7.10.4
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

LGTM


More information about the ffmpeg-devel mailing list