Re: [FFmpeg-devel] [PATCH 4/4] lavc/libaribb24: use integer math to calculate font scaling

2019-02-11 Thread Michael Niedermayer
On Mon, Feb 11, 2019 at 03:06:54AM +0200, Jan Ekström wrote:
> ---
>  libavcodec/libaribb24.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

LGTM

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 4/4] lavc/libaribb24: use integer math to calculate font scaling

2019-02-10 Thread Jan Ekström
---
 libavcodec/libaribb24.c | 10 +-
 1 file 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
-- 
2.20.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel