The branch, master has been updated
via efd6e85abbf8cbea5992554823b27e2e32c8f2c3 (commit)
via 5717c5c1e14758df87017e6d0db5f75e3414f845 (commit)
from 04a9e2a80913b176e29cfd6630cf8ac6426b5a44 (commit)
- Log -----------------------------------------------------------------
commit efd6e85abbf8cbea5992554823b27e2e32c8f2c3
Author: Ayose <[email protected]>
AuthorDate: Mon Nov 24 15:43:51 2025 +0000
Commit: Marton Balint <[email protected]>
CommitDate: Mon Nov 24 20:01:40 2025 +0000
fftools/tf_mermaid: close subgraph header when there are no inputs.
Ensure that the fragment to close the header (`</div>\"]`) is written when
the
function `mermaid_print_section_header` is called only once, which happens
when
the filtergraph has no inputs.
diff --git a/fftools/textformat/tf_mermaid.c b/fftools/textformat/tf_mermaid.c
index eb28ffb6ab..fae53d9c40 100644
--- a/fftools/textformat/tf_mermaid.c
+++ b/fftools/textformat/tf_mermaid.c
@@ -456,6 +456,8 @@ static void
mermaid_print_section_footer(AVTextFormatContext *tfc)
} else if ((section->flags & AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH)) {
+ mermaid_subgraph_complete_start(mmc, tfc, tfc->level);
+
MM_INDENT();
writer_put_str(tfc, "end\n");
commit 5717c5c1e14758df87017e6d0db5f75e3414f845
Author: Ayose <[email protected]>
AuthorDate: Mon Nov 24 15:40:20 2025 +0000
Commit: Marton Balint <[email protected]>
CommitDate: Mon Nov 24 20:01:40 2025 +0000
fftools/tf_mermaid: logic to complete subgraphs in a reusable function.
`subgraph` blocks can be closed in different places. The logic to complete
the
header is moved to a function, so it can be reused later.
diff --git a/fftools/textformat/tf_mermaid.c b/fftools/textformat/tf_mermaid.c
index ef730d570b..eb28ffb6ab 100644
--- a/fftools/textformat/tf_mermaid.c
+++ b/fftools/textformat/tf_mermaid.c
@@ -240,6 +240,20 @@ static void set_str(const char **dst, const char *src)
*dst = av_strdup(src);
}
+static void mermaid_subgraph_complete_start(MermaidContext *mmc,
AVTextFormatContext *tfc, int level) {
+ struct section_data parent_sec_data = mmc->section_data[level];
+ AVBPrint *parent_buf = &tfc->section_pbuf[level];
+
+ if (parent_sec_data.subgraph_start_incomplete) {
+ if (parent_buf->len > 0)
+ writer_printf(tfc, "%s", parent_buf->str);
+
+ writer_put_str(tfc, "</div>\"]\n");
+
+ mmc->section_data[level].subgraph_start_incomplete = 0;
+ }
+}
+
#define MM_INDENT() writer_printf(tfc, "%*c", mmc->indent_level * 2, ' ')
static void mermaid_print_section_header(AVTextFormatContext *tfc, const void
*data)
@@ -296,19 +310,7 @@ static void
mermaid_print_section_header(AVTextFormatContext *tfc, const void *d
}
if (parent_section && parent_section->flags &
AV_TEXTFORMAT_SECTION_FLAG_IS_SUBGRAPH) {
-
- struct section_data parent_sec_data = mmc->section_data[tfc->level -
1];
- AVBPrint *parent_buf = &tfc->section_pbuf[tfc->level - 1];
-
- if (parent_sec_data.subgraph_start_incomplete) {
-
- if (parent_buf->len > 0)
- writer_printf(tfc, "%s", parent_buf->str);
-
- writer_put_str(tfc, "</div>\"]\n");
-
- mmc->section_data[tfc->level - 1].subgraph_start_incomplete = 0;
- }
+ mermaid_subgraph_complete_start(mmc, tfc, tfc->level - 1);
}
av_freep(&mmc->section_data[tfc->level].section_id);
-----------------------------------------------------------------------
Summary of changes:
fftools/textformat/tf_mermaid.c | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]