[FFmpeg-devel] [PATCH] graphparser: simplify condition in avfilter_graph_parse()

Stefano Sabatini stefano.sabatini-lala at poste.it
Thu Jul 7 01:25:20 CEST 2011


On date Saturday 2011-07-02 16:31:31 +0200, Stefano Sabatini encoded:
> The new check is simpler and does not depends on the content of
> open_inputs.
> ---
>  libavfilter/graphparser.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
> index bf1c204..e0edd92 100644
> --- a/libavfilter/graphparser.c
> +++ b/libavfilter/graphparser.c
> @@ -389,7 +389,7 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
>          goto fail;
>      }
>  
> -    if (open_inputs && *open_inputs && !strcmp((*open_inputs)->name, "out") && curr_inputs) {
> +    if (curr_inputs) {
>          /* Last output pad, assume it is "[out]" if not specified */
>          const char *tmp = "[out]";
>          if ((ret = parse_outputs(&tmp, &curr_inputs, &open_inputs, &open_outputs,

Just for clarifying this change, suppose we reached the last filter in
the filtergraph, which doesn't specify an output label, e.g. like in
"null" or "nullsrc,split".

Since avfilter_graph_parse() creates the "[in]" inout for the first
unlabeled input pad, I expect it will create an "[out]" inout for last
output pad, even if it can't bind it to any provided "open input".

So the patch simplifies the condition to check while implementing a
more "natural" behavior.
-- 
FFmpeg = Fierce Freak Magical Power Encoding/decoding Gadget
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-graphparser-simplify-condition-in-avfilter_graph_par.patch
Type: text/x-diff
Size: 1219 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110707/f656d8d3/attachment.bin>


More information about the ffmpeg-devel mailing list