You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
fftools/textformat/avtextformat: Simplify avtext_print_rational()
Use snprintf() directly instead of initializing an AVBPrint just for this. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user