diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-09-10 13:36:27 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-09-11 01:14:57 +0200 |
commit | 0c71d5a077de20aee220fe30ea752862c9ca3f9c (patch) | |
tree | 3a622556bf2b73466719cbb7541a3221bc206553 /ffprobe.c | |
parent | f740c1a9c2a6b70b44b59faeb27e1a9cd8e9ec39 (diff) | |
download | ffmpeg-0c71d5a077de20aee220fe30ea752862c9ca3f9c.tar.gz |
ffprobe: add print_section option to the compact writer
Allow to skip section name at the begin of each line. Possibly simplify
output.
Diffstat (limited to 'ffprobe.c')
-rw-r--r-- | ffprobe.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -593,6 +593,7 @@ typedef struct CompactContext { char *item_sep_str; char item_sep; int nokey; + int print_section; char *escape_mode_str; const char * (*escape_str)(AVBPrint *dst, const char *src, const char sep, void *log_ctx); } CompactContext; @@ -607,6 +608,8 @@ static const AVOption compact_options[]= { {"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 }, {"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX }, {"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX }, + {"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 }, + {"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 }, {NULL}, }; @@ -653,7 +656,8 @@ static void compact_print_section_header(WriterContext *wctx, const char *sectio { CompactContext *compact = wctx->priv; - printf("%s%c", section, compact->item_sep); + if (compact->print_section) + printf("%s%c", section, compact->item_sep); } static void compact_print_section_footer(WriterContext *wctx, const char *section) |