[vlc-commits] codec: ttml: fix region percent origin

Francois Cartegnie git at videolan.org
Thu Sep 28 20:39:25 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 28 19:59:47 2017 +0200| [c65b1f6a52a72dcf3806a9a914ab0e7c835ebab5] | committer: Francois Cartegnie

codec: ttml: fix region percent origin

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

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

diff --git a/modules/codec/ttml/substtml.c b/modules/codec/ttml/substtml.c
index ea540ba834..9300f7671f 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -328,7 +328,10 @@ static void FillRegionStyle( const char *psz_attr, const char *psz_val,
 
         p_region->updt.origin.x = atoi( psz_token );
         if( psz_percent_sign != NULL && psz_percent_sign < psz_separator )
-            p_region->updt.flags |= UPDT_REGION_EXTENT_X_IS_PERCENTILE;
+        {
+            p_region->updt.origin.x /= 100.0;
+            p_region->updt.flags |= UPDT_REGION_ORIGIN_X_IS_PERCENTILE;
+        }
 
         while( isspace( *psz_separator ) )
             psz_separator++;
@@ -337,7 +340,11 @@ static void FillRegionStyle( const char *psz_attr, const char *psz_val,
 
         p_region->updt.origin.y = atoi( psz_token );
         if( psz_percent_sign != NULL )
-            p_region->updt.flags |= UPDT_REGION_EXTENT_Y_IS_PERCENTILE;
+        {
+            p_region->updt.origin.y /= 100.0;
+            p_region->updt.flags |= UPDT_REGION_ORIGIN_Y_IS_PERCENTILE;
+        }
+        p_region->updt.align = SUBPICTURE_ALIGN_TOP|SUBPICTURE_ALIGN_LEFT;
     }
 }
 



More information about the vlc-commits mailing list