| @@ -289,10 +289,20 @@ void avtext_print_section_footer(AVTextFormatContext *tctx) · 288 unmodified lines |
| 289 | tctx->level--; | 289 | tctx->level--; |
| 290 | } | 290 | } |
| 291 | | 291 | |
| 292 | void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val) | 292 | void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t val, int flags) |
| 293 | { | 293 | { |
| 294 | const AVTextFormatSection *section; | 294 | const AVTextFormatSection *section; |
| 295 | | 295 | |
| | 296 | av_assert0(tctx); |
| | 297 | |
| | 298 | if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER) |
| | 299 | return; |
| | 300 | |
| | 301 | if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO |
| | 302 | && (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL) |
| | 303 | && !(tctx->formatter->flags & AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS)) |
| | 304 | return; |
| | 305 | |
| 296 | av_assert0(key && tctx->level >= 0 && tctx->level < SECTION_MAX_NB_LEVELS); | 306 | av_assert0(key && tctx->level >= 0 && tctx->level < SECTION_MAX_NB_LEVELS); |
| 297 | | 307 | |
| 298 | section = tctx->section[tctx->level]; | 308 | section = tctx->section[tctx->level]; |
| @@ -444,10 +454,12 @@ int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char * · 145 unmodified lines |
| 444 | | 454 | |
| 445 | section = tctx->section[tctx->level]; | 455 | section = tctx->section[tctx->level]; |
| 446 | | 456 | |
| 447 | if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER || | 457 | if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER) |
| 448 | (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO | 458 | return 0; |
| 449 | && (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL) | 459 | |
| 450 | && !(tctx->formatter->flags & AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS))) | 460 | if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO |
| | 461 | && (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL) |
| | 462 | && !(tctx->formatter->flags & AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS)) |
| 451 | return 0; | 463 | return 0; |
| 452 | | 464 | |
| 453 | if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) { | 465 | if (section->show_all_entries || av_dict_get(section->entries_to_show, key, NULL, 0)) { |
| @@ -503,7 +515,7 @@ void avtext_print_ts(AVTextFormatContext *tctx, const char *key, int64_t ts, int · 49 unmodified lines |
| 503 | if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) | 515 | if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) |
| 504 | avtext_print_string(tctx, key, "N/A", AV_TEXTFORMAT_PRINT_STRING_OPTIONAL); | 516 | avtext_print_string(tctx, key, "N/A", AV_TEXTFORMAT_PRINT_STRING_OPTIONAL); |
| 505 | else | 517 | else |
| 506 | avtext_print_integer(tctx, key, ts); | 518 | avtext_print_integer(tctx, key, ts, 0); |
| 507 | } | 519 | } |
| 508 | | 520 | |
| 509 | void avtext_print_data(AVTextFormatContext *tctx, const char *key, | 521 | void avtext_print_data(AVTextFormatContext *tctx, const char *key, |