[FFmpeg-devel] [PATCH] ffprobe: add multiple_sections field to the Writer

Stefano Sabatini stefasab at gmail.com
Tue May 29 01:07:11 CEST 2012


On date Sunday 2012-05-27 10:00:57 +0200, Clément Bœsch encoded:
> On Sun, May 27, 2012 at 01:32:20AM +0200, Stefano Sabatini wrote:
> > Move the field from the JSON writer private context. This allows to
> > factorize the code with the pending INI format patch.
> > ---
> >  ffprobe.c |   10 +++++-----
> >  1 files changed, 5 insertions(+), 5 deletions(-)
[...]
> > @@ -715,7 +719,6 @@ static const Writer csv_writer = {
> >  
> >  typedef struct {
> >      const AVClass *class;
> > -    int multiple_entries; ///< tells if the given chapter requires multiple entries
> >      int print_packets_and_frames;
> >      int indent_level;
> >      int compact;
> > @@ -806,10 +809,7 @@ static void json_print_chapter_header(WriterContext *wctx, const char *chapter)
> >      if (wctx->nb_chapter)
> >          printf(",");
> >      printf("\n");
> > -    json->multiple_entries = !strcmp(chapter, "packets") || !strcmp(chapter, "frames" ) ||
> > -                             !strcmp(chapter, "packets_and_frames") ||
> > -                             !strcmp(chapter, "streams") || !strcmp(chapter, "library_versions");
> > -    if (json->multiple_entries) {
> > +    if (wctx->multiple_sections) {
> >          JSON_INDENT();
> >          av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED);
> >          printf("\"%s\": [\n", json_escape_str(&buf, chapter, wctx));
> 
> 
> I see more occurrences of the multiple_entries you removed in the JSON.

Yep, the patch was a bit sloppy.
 
> I don't mind much the rename from multiple_entries to multiple_sections
> (should be more consistent), but it could be mentioned.

Fixed patch and commit message, and applied, thanks.
-- 
FFmpeg = Fabulous and Foolish Magical Problematic Exuberant Genius


More information about the ffmpeg-devel mailing list