[vlc-commits] codec: ttml: read/store horizontal resolution

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


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Nov 11 14:26:06 2017 +0100| [d8534b1d4b3701d9a94eca7417f251533d2fbea1] | committer: Francois Cartegnie

codec: ttml: read/store horizontal resolution

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

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

diff --git a/modules/codec/ttml/substtml.c b/modules/codec/ttml/substtml.c
index 585a5f16b3..ef170ac8f8 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -81,6 +81,7 @@ typedef struct
     tt_node_t *      p_rootnode; /* for now. FIXME: split header */
     ttml_length_t    root_extent_h, root_extent_v;
     unsigned         i_cell_resolution_v;
+    unsigned         i_cell_resolution_h;
 } ttml_context_t;
 
 typedef struct
@@ -901,6 +902,7 @@ static void InitTTMLContext( tt_node_t *p_rootnode, ttml_context_t *p_ctx )
     p_ctx->root_extent_v.i_value = 100;
     p_ctx->root_extent_v.unit = TTML_UNIT_PERCENT;
     p_ctx->i_cell_resolution_v = TTML_DEFAULT_CELL_RESOLUTION_V;
+    p_ctx->i_cell_resolution_h = TTML_DEFAULT_CELL_RESOLUTION_H;
     /* and override them */
     const char *value = vlc_dictionary_value_for_key( &p_rootnode->attr_dict,
                                                       "tts:extent" );
@@ -915,7 +917,10 @@ static void InitTTMLContext( tt_node_t *p_rootnode, ttml_context_t *p_ctx )
     {
         unsigned w, h;
         if( sscanf( value, "%u %u", &w, &h) == 2 && w && h )
+        {
+            p_ctx->i_cell_resolution_h = w;
             p_ctx->i_cell_resolution_v = h;
+        }
     }
 }
 



More information about the vlc-commits mailing list