[vlc-commits] codec: ttml: ensure textAlign flags are not overwritten/ting

Francois Cartegnie git at videolan.org
Tue Nov 14 18:54:12 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Nov 12 17:16:59 2017 +0100| [fc61f78fae90196a01737b69bdb3e04d2e787d07] | committer: Francois Cartegnie

codec: ttml: ensure textAlign flags are not overwritten/ting

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

 modules/codec/ttml/substtml.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/codec/ttml/substtml.c b/modules/codec/ttml/substtml.c
index ded8f47439..3033bb0c98 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -454,16 +454,15 @@ static void FillTTMLStyle( const char *psz_attr, const char *psz_val,
     }
     else if( !strcasecmp( "tts:textAlign", psz_attr ) )
     {
+        p_ttml_style->i_text_align &= ~(SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT);
         if( !strcasecmp ( "left", psz_val ) )
-            p_ttml_style->i_text_align = SUBPICTURE_ALIGN_LEFT;
+            p_ttml_style->i_text_align |= SUBPICTURE_ALIGN_LEFT;
         else if( !strcasecmp ( "right", psz_val ) )
-            p_ttml_style->i_text_align = SUBPICTURE_ALIGN_RIGHT;
-        else if( !strcasecmp ( "center", psz_val ) )
-            p_ttml_style->i_text_align = 0;
+            p_ttml_style->i_text_align |= SUBPICTURE_ALIGN_RIGHT;
         else if( !strcasecmp ( "start", psz_val ) ) /* FIXME: should be BIDI based */
-            p_ttml_style->i_text_align = SUBPICTURE_ALIGN_LEFT;
+            p_ttml_style->i_text_align |= SUBPICTURE_ALIGN_LEFT;
         else if( !strcasecmp ( "end", psz_val ) )  /* FIXME: should be BIDI based */
-            p_ttml_style->i_text_align = SUBPICTURE_ALIGN_RIGHT;
+            p_ttml_style->i_text_align |= SUBPICTURE_ALIGN_RIGHT;
     }
     else if( !strcasecmp( "tts:fontSize", psz_attr ) )
     {



More information about the vlc-commits mailing list