[vlc-devel] [PATCH 17/19] ttml codec: add displayAlign attribute support

Stanislas Plessia stplessia at gmail.com
Wed Aug 31 12:20:21 CEST 2016


---
 modules/codec/substtml.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/codec/substtml.c b/modules/codec/substtml.c
index 695dcf0..14eee3f 100644
--- a/modules/codec/substtml.c
+++ b/modules/codec/substtml.c
@@ -354,6 +354,15 @@ static ttml_style_t* ParseTTMLStyle( decoder_t *p_dec, xml_reader_t* p_reader, c
             else if( !strcasecmp ( "end", val ) )
                 p_ttml_style->i_align = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT;
         }
+        else if( !strcasecmp( "tts:displayAlign", attr ) )
+        {
+            if( !strcasecmp ( "before", val ) )
+                p_ttml_style->i_align = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT;
+            else if( !strcasecmp ( "after", val ) )
+                p_ttml_style->i_align = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT;
+            else if( !strcasecmp ( "center", val ) )
+                p_ttml_style->i_align = SUBPICTURE_ALIGN_BOTTOM;
+        }
         else if( !strcasecmp( "tts:fontStyle", attr ) )
         {
             if( !strcasecmp ( "italic", val ) || !strcasecmp ( "oblique", val ) )
-- 
2.7.4



More information about the vlc-devel mailing list