aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/textformat/tw_buffer.c
diff options
context:
space:
mode:
authorsoftworkz <softworkz@hotmail.com>2025-04-29 01:35:50 +0200
committersoftworkz <softworkz@hotmail.com>2025-05-15 23:04:44 +0200
commitcee7b8a051739d9fa6b41f961ecec480cdaa02bd (patch)
treee6e29b87d6ec9aa4b45a77988ce81e750109bbb4 /fftools/textformat/tw_buffer.c
parente4830b8c5e589ae77d4e1c9dc68a1a6240cfc3c3 (diff)
downloadffmpeg-cee7b8a051739d9fa6b41f961ecec480cdaa02bd.tar.gz
fftools/textformat: Introduce common header and deduplicate code
Also change writer_printf signature in AVTextWriter to use va_list, so that it can be called by the new function writer_printf() in tf_internal.h. Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: softworkz <softworkz@hotmail.com>
Diffstat (limited to 'fftools/textformat/tw_buffer.c')
-rw-r--r--fftools/textformat/tw_buffer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fftools/textformat/tw_buffer.c b/fftools/textformat/tw_buffer.c
index f8b38414a6..f6e63445d9 100644
--- a/fftools/textformat/tw_buffer.c
+++ b/fftools/textformat/tw_buffer.c
@@ -56,14 +56,11 @@ static void buffer_put_str(AVTextWriterContext *wctx, const char *str)
av_bprintf(ctx->buffer, "%s", str);
}
-static void buffer_printf(AVTextWriterContext *wctx, const char *fmt, ...)
+static void buffer_vprintf(AVTextWriterContext *wctx, const char *fmt, va_list vl)
{
BufferWriterContext *ctx = wctx->priv;
- va_list vargs;
- va_start(vargs, fmt);
- av_vbprintf(ctx->buffer, fmt, vargs);
- va_end(vargs);
+ av_vbprintf(ctx->buffer, fmt, vl);
}
@@ -72,7 +69,7 @@ const AVTextWriter avtextwriter_buffer = {
.priv_size = sizeof(BufferWriterContext),
.priv_class = &bufferwriter_class,
.writer_put_str = buffer_put_str,
- .writer_printf = buffer_printf,
+ .writer_vprintf = buffer_vprintf,
.writer_w8 = buffer_w8
};