From e54f813ea94fad0081f79aad8c35daa858300176 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 14 Apr 2025 22:13:19 +0200
Subject: [PATCH 01/12] fftools/textformat/avtextformat: Simplify
 avtext_print_rational()

Use snprintf() directly instead of initializing an AVBPrint
just for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 fftools/textformat/avtextformat.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fftools/textformat/avtextformat.c b/fftools/textformat/avtextformat.c
index 6c09f9d2cd..c1b5eefab4 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -460,10 +460,9 @@ int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char *
 void avtext_print_rational(AVTextFormatContext *tctx,
                                          const char *key, AVRational q, char sep)
 {
-    AVBPrint buf;
-    av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
-    av_bprintf(&buf, "%d%c%d", q.num, sep, q.den);
-    avtext_print_string(tctx, key, buf.str, 0);
+    char buf[44];
+    snprintf(buf, sizeof(buf), "%d%c%d", q.num, sep, q.den);
+    avtext_print_string(tctx, key, buf, 0);
 }
 
 void avtext_print_time(AVTextFormatContext *tctx, const char *key,
-- 
2.45.2