1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

ffprobe/xml: use writer multiple_sections instead of local context variable.

This commit is contained in:
Clément Bœsch 2012-05-29 23:21:43 +02:00
parent 2248db946c
commit db839544d6

View File

@ -1114,7 +1114,6 @@ static const Writer json_writer = {
typedef struct { typedef struct {
const AVClass *class; const AVClass *class;
int within_tag; int within_tag;
int multiple_entries; ///< tells if the given chapter requires multiple entries
int indent_level; int indent_level;
int fully_qualified; int fully_qualified;
int xsd_strict; int xsd_strict;
@ -1229,11 +1228,7 @@ static void xml_print_chapter_header(WriterContext *wctx, const char *chapter)
if (wctx->nb_chapter) if (wctx->nb_chapter)
printf("\n"); printf("\n");
xml->multiple_entries = !strcmp(chapter, "packets") || !strcmp(chapter, "frames") || if (wctx->multiple_sections) {
!strcmp(chapter, "packets_and_frames") ||
!strcmp(chapter, "streams") || !strcmp(chapter, "library_versions");
if (xml->multiple_entries) {
XML_INDENT(); printf("<%s>\n", chapter); XML_INDENT(); printf("<%s>\n", chapter);
xml->indent_level++; xml->indent_level++;
} }
@ -1243,7 +1238,7 @@ static void xml_print_chapter_footer(WriterContext *wctx, const char *chapter)
{ {
XMLContext *xml = wctx->priv; XMLContext *xml = wctx->priv;
if (xml->multiple_entries) { if (wctx->multiple_sections) {
xml->indent_level--; xml->indent_level--;
XML_INDENT(); printf("</%s>\n", chapter); XML_INDENT(); printf("</%s>\n", chapter);
} }