[vlc-commits] codec: ttml: fix reading displayAlign

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


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

codec: ttml: fix reading displayAlign

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

 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 4c58313a51..ded8f47439 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -355,12 +355,11 @@ static void FillRegionStyle( const char *psz_attr, const char *psz_val,
 {
     if( !strcasecmp( "tts:displayAlign", psz_attr ) )
     {
-        if( !strcasecmp ( "top", psz_val ) )
-            p_region->updt.align = SUBPICTURE_ALIGN_TOP;
-        else if( !strcasecmp ( "center", psz_val ) )
-            p_region->updt.align = 0;
-        else
-            p_region->updt.align = SUBPICTURE_ALIGN_BOTTOM;
+        p_region->updt.inner_align &= ~(SUBPICTURE_ALIGN_TOP|SUBPICTURE_ALIGN_BOTTOM);
+        if( !strcasecmp ( "before", psz_val ) )
+            p_region->updt.inner_align |= SUBPICTURE_ALIGN_TOP;
+        else if( !strcasecmp ( "after", psz_val ) )
+            p_region->updt.inner_align |= SUBPICTURE_ALIGN_BOTTOM;
     }
     else if( !strcasecmp ( "tts:origin", psz_attr ) ||
              !strcasecmp ( "tts:extent", psz_attr ) )



More information about the vlc-commits mailing list