aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2019-02-11 03:01:51 +0200
committerJan Ekström <jeebjp@gmail.com>2019-02-12 20:16:40 +0200
commit466cb4ed56a12d0081ed7005a8e8663d1b8806ca (patch)
treeed04792c708be23bf2fa7632a2ec8973cf078958
parent1ed9e8e9377d4c63e2921efc0b1e444120c06de1 (diff)
downloadffmpeg-466cb4ed56a12d0081ed7005a8e8663d1b8806ca.tar.gz
lavc/libaribb24: use integer math to calculate font scaling
-rw-r--r--libavcodec/libaribb24.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c
index 28f20ca767..3a59938451 100644
--- a/libavcodec/libaribb24.c
+++ b/libavcodec/libaribb24.c
@@ -249,11 +249,11 @@ static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub)
// font size
if (region->i_fontwidth != profile_font_size ||
region->i_fontheight != profile_font_size) {
- av_bprintf(&buf, "{\\fscx%d\\fscy%d}",
- (int)round(((double)region->i_fontwidth /
- (double)profile_font_size) * 100),
- (int)round(((double)region->i_fontheight /
- (double)profile_font_size) * 100));
+ av_bprintf(&buf, "{\\fscx%"PRId64"\\fscy%"PRId64"}",
+ av_rescale(region->i_fontwidth, 100,
+ profile_font_size),
+ av_rescale(region->i_fontheight, 100,
+ profile_font_size));
}
// TODO: positioning