[vlc-commits] codec: ttml: fix font size in percent

Francois Cartegnie git at videolan.org
Thu Oct 26 16:58:47 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 26 16:57:46 2017 +0200| [34d436b3e773e948064de6b8cc111665ef683895] | committer: Francois Cartegnie

codec: ttml: fix font size in percent

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=34d436b3e773e948064de6b8cc111665ef683895
---

 modules/codec/ttml/substtml.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/codec/ttml/substtml.c b/modules/codec/ttml/substtml.c
index 6f25f0169a..bd82623d66 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -431,7 +431,8 @@ static void ComputeTTMLStyles( ttml_context_t *p_ctx, const vlc_dictionary_t *p_
         p_text_style->f_font_relsize = 100.0 * len.i_value /
                     (p_ctx->i_cell_resolution_v / TTML_LINE_TO_HEIGHT_RATIO);
     else if( len.unit == TTML_UNIT_PERCENT )
-        p_text_style->f_font_relsize = len.i_value;
+        p_text_style->f_font_relsize = len.i_value /
+                    (p_ctx->i_cell_resolution_v / TTML_LINE_TO_HEIGHT_RATIO);
     else if( len.unit == TTML_UNIT_PIXELS )
         p_text_style->i_font_size = (int)( len.i_value + 0.5 );
 }



More information about the vlc-commits mailing list