This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 217e431d2dd24ba71e20f93408bb0ae8cedc073b Author: Kacper Michajłow <[email protected]> AuthorDate: Sun Aug 16 14:55:37 2026 +0200 Commit: Kacper Michajłow <[email protected]> CommitDate: Tue Sep 8 20:00:11 2026 +0000 fftools/textformat: terminate parent's line before an array of row elements Sections like programs print their member streams as separate rows, but the parent's own line was only terminated by its footer, which runs after the children. This fused the parent's fields with the first member row: Before: program|tag:variant_bitrate=1945335|stream|index=0 stream|index=2 After program|tag:variant_bitrate=1945335 stream|index=0 stream|index=2 Write the newline when such an array starts. Arrays with typed elements (e.g. side data) keep continuing the line, as their elements print inline. Signed-off-by: Kacper Michajłow <[email protected]> --- fftools/textformat/tf_compact.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fftools/textformat/tf_compact.c b/fftools/textformat/tf_compact.c index fc6bd5250b..9cb89b3fe9 100644 --- a/fftools/textformat/tf_compact.c +++ b/fftools/textformat/tf_compact.c @@ -138,6 +138,15 @@ static av_cold int compact_init(AVTextFormatContext *wctx) return 0; } +static int array_has_inline_elems(const AVTextFormatContext *wctx, + const AVTextFormatSection *section) +{ + for (int i = 0; section->children_ids[i] != -1; i++) + if (wctx->sections[section->children_ids[i]].flags & AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE) + return 1; + return 0; +} + static void compact_print_section_header(AVTextFormatContext *wctx, const void *data) { CompactContext *compact = wctx->priv; @@ -184,9 +193,12 @@ static void compact_print_section_header(AVTextFormatContext *wctx, const void * wctx->nb_item[wctx->level] = wctx->nb_item[wctx->level - 1]; } else { - if (parent_section && !(parent_section->flags & (AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER | AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY)) && - wctx->level && wctx->nb_item[wctx->level - 1]) - writer_w8(wctx, compact->item_sep); + if (parent_section && !(parent_section->flags & (AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER | AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY))) { + if (section->flags & AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY && !array_has_inline_elems(wctx, section)) + writer_w8(wctx, '\n'); + else if (wctx->level && wctx->nb_item[wctx->level - 1]) + writer_w8(wctx, compact->item_sep); + } if (compact->print_section && !(section->flags & (AV_TEXTFORMAT_SECTION_FLAG_IS_WRAPPER | AV_TEXTFORMAT_SECTION_FLAG_IS_ARRAY))) writer_printf(wctx, "%s%c", section->name, compact->item_sep); -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
