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

Michael Niedermayer michaelni at gmx.at
Sat Jul 9 23:52:03 CEST 2011


On Thu, Jul 07, 2011 at 01:25:20AM +0200, Stefano Sabatini wrote:
> 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

>  graphparser.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> ee99ace1ca42844393d3e74bf5eb0765fc369a65  0001-graphparser-simplify-condition-in-avfilter_graph_par.patch
> From 560fcab0b5d0fa151040f87661bec219727e198e Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sat, 2 Jul 2011 15:37:32 +0200
> Subject: [PATCH] graphparser: simplify condition in avfilter_graph_parse()

LGTM if tested

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110709/17d7e8d6/attachment.asc>


More information about the ffmpeg-devel mailing list