[vlc-commits] ttml codec: add MergeTTMLStyle function for style inheritence
Stanislas Plessia
git at videolan.org
Wed Sep 14 18:39:43 CEST 2016
vlc | branch: master | Stanislas Plessia <stplessia at gmail.com> | Mon Aug 29 16:01:03 2016 +0200| [a4579632b945355d15c0c99adc6c37ee71a4a037] | committer: Hugo Beauzée-Luyssen
ttml codec: add MergeTTMLStyle function for style inheritence
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a4579632b945355d15c0c99adc6c37ee71a4a037
---
modules/codec/substtml.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/modules/codec/substtml.c b/modules/codec/substtml.c
index daa561a..1534f95 100644
--- a/modules/codec/substtml.c
+++ b/modules/codec/substtml.c
@@ -80,6 +80,25 @@ struct decoder_sys_t
size_t i_styles;
};
+static void MergeTTMLStyle( ttml_style_t *p_dst, const ttml_style_t *p_src)
+{
+ text_style_Merge( p_dst->font_style, p_src->font_style, false );
+ if( !( p_dst->i_align & SUBPICTURE_ALIGN_MASK ) )
+ p_dst->i_align |= p_src->i_align;
+
+ if( !p_dst->i_margin_h )
+ p_dst->i_margin_h = p_src->i_margin_h;
+
+ if( !p_dst->i_margin_v )
+ p_dst->i_margin_v = p_src->i_margin_v;
+
+ if( !p_dst->i_margin_percent_h )
+ p_dst->i_margin_percent_h = p_src->i_margin_percent_h;
+
+ if( !p_dst->i_margin_percent_v )
+ p_dst->i_margin_percent_v = p_src->i_margin_percent_v;
+}
+
static ttml_style_t *FindTextStyle( decoder_t *p_dec, const char *psz_style )
{
decoder_sys_t *p_sys = p_dec->p_sys;
More information about the vlc-commits
mailing list