[FFmpeg-devel] [PATCH 3/4] ffprobe/xml: use writer multiple_sections instead of local context variable.

Stefano Sabatini stefasab at gmail.com
Wed May 30 01:22:00 CEST 2012


On date Tuesday 2012-05-29 23:24:41 +0200, Clément Bœsch encoded:
> ---
>  ffprobe.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index f2ddf6e..27ab62e 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -1117,7 +1117,6 @@ static const Writer json_writer = {
>  typedef struct {
>      const AVClass *class;
>      int within_tag;
> -    int multiple_entries; ///< tells if the given chapter requires multiple entries
>      int indent_level;
>      int fully_qualified;
>      int xsd_strict;
> @@ -1232,11 +1231,7 @@ static void xml_print_chapter_header(WriterContext *wctx, const char *chapter)
>  
>      if (wctx->nb_chapter)
>          printf("\n");
> -    xml->multiple_entries = !strcmp(chapter, "packets") || !strcmp(chapter, "frames") ||
> -                            !strcmp(chapter, "packets_and_frames") ||
> -                            !strcmp(chapter, "streams") || !strcmp(chapter, "library_versions");
> -
> -    if (xml->multiple_entries) {
> +    if (wctx->multiple_sections) {
>          XML_INDENT(); printf("<%s>\n", chapter);
>          xml->indent_level++;
>      }
> @@ -1246,7 +1241,7 @@ static void xml_print_chapter_footer(WriterContext *wctx, const char *chapter)
>  {
>      XMLContext *xml = wctx->priv;
>  
> -    if (xml->multiple_entries) {
> +    if (wctx->multiple_sections) {
>          xml->indent_level--;
>          XML_INDENT(); printf("</%s>\n", chapter);
>      }

Sure, I forgot about this, thanks.
-- 
FFmpeg = Fostering and Fabulous Mystic Proud Elitarian God


More information about the ffmpeg-devel mailing list