[FFmpeg-devel] [PATCH] ffprobe: do not print section_sep if it is not defined in the writer

Stefano Sabatini stefasab at gmail.com
Sun Sep 25 12:24:33 CEST 2011


On date Sunday 2011-09-25 02:35:53 +0200, Clément Bœsch encoded:
> On Sun, Sep 25, 2011 at 02:16:58AM +0200, Clément Bœsch wrote:
> > On Sun, Sep 25, 2011 at 02:09:11AM +0200, Stefano Sabatini wrote:
> > > Avoid the need of having to specify it in the writer definitions.
> > > ---
> > >  ffprobe.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/ffprobe.c b/ffprobe.c
> > > index cabc8c8..d12c98c 100644
> > > --- a/ffprobe.c
> > > +++ b/ffprobe.c
> > > @@ -560,7 +560,7 @@ static int get_writer(const char *name)
> > >          show_ ## name (w, fmt_ctx);                           \
> > >          if (w->print_section_end)                             \
> > >              w->print_section_end(#name, multiple_entries);    \
> > > -        if (left)                                             \
> > > +        if (left && w->section_sep)                           \
> > >              printf("%s", w->section_sep);                     \
> > >      }                                                         \
> > >  } while (0)
> > 
> > OK
> > 
> > Note: maybe we should doxycomment which field are mandatory, and which
> > aren't.
> > 
> 

> Mmmh actually, I think it lacks parenthesis around the left. It doesn't
> work for the show_packets case for instance.

Yes right.

Althouhg on a second thought, I prefer to drop the patch, and make all
the fields implicitely mandatory, should be less confusing.
-- 
FFmpeg = Funny Furious MultiPurpose Enigmatic Guru


More information about the ffmpeg-devel mailing list