[FFmpeg-devel] [PATCH] avfilter/graphparser: remove '\n' from parse_filter

Michael Niedermayer michael at niedermayer.cc
Sat Jun 4 19:33:40 CEST 2016


On Thu, Jun 02, 2016 at 03:32:49PM +0700, Muhammad Faiz wrote:
> On Thu, May 5, 2016 at 2:21 PM, Muhammad Faiz <mfcc64 at gmail.com> wrote:
> > this allow a filter to be written like this:
> > aformat =
> >     sample_fmts  = fltp|flt:
> >     sample_rates = 44100|44800
> >
> > Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> > ---
> >  libavfilter/graphparser.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
> > index 8d15b5d..03062af 100644
> > --- a/libavfilter/graphparser.c
> > +++ b/libavfilter/graphparser.c
> > @@ -165,12 +165,12 @@ static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGr
> >                          int index, void *log_ctx)
> >  {
> >      char *opts = NULL;
> > -    char *name = av_get_token(buf, "=,;[\n");
> > +    char *name = av_get_token(buf, "=,;[");
> >      int ret;
> >
> >      if (**buf == '=') {
> >          (*buf)++;
> > -        opts = av_get_token(buf, "[],;\n");
> > +        opts = av_get_token(buf, "[],;");
> >      }
> >
> >      ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
> > --
> > 2.5.0
> >
> 
> No response. So, I will try to explain this patch.
> It allows filter definition to span across multiple lines.
> This behaviour is useful to make filter graph more readable,
> especially when stored on file.
> 
> For example, using lavfi
> ffplay -graph_file filter.txt -f lavfi my_lavfi
> filter.txt:
> 
> amovie=audio.mp3,
> aformat=
>     channel_layouts = stereo:
>     sample_rates    = 48000:
>     sample_fmts     = flt|fltp,
> asplit [out0],
> showcqt =
>     tc = 0.33:
>     fps = 60
> [out1]

Can this break (realistic) existing and documented as working cases ?


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160604/b4846cbc/attachment.sig>


More information about the ffmpeg-devel mailing list