[vlc-commits] demux: ttml: probe extra namespaces

Francois Cartegnie git at videolan.org
Thu Apr 27 20:04:23 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 27 20:02:44 2017 +0200| [4f3195a340bd1a405e0f4f260ad9f45d0352aceb] | committer: Francois Cartegnie

demux: ttml: probe extra namespaces

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

 modules/demux/ttml.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 791af45d72..14c9ffcea8 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -440,8 +440,19 @@ int OpenDemux( vlc_object_t* p_this )
     }
     else
     {
-        const char *psz_ns = strnstr( psz_xml, "=\"http://www.w3.org/ns/ttml\"",
-                                      i_xml -( (ptrdiff_t)psz_tt - (ptrdiff_t)psz_xml ) );
+        const char * const rgsz[] =
+        {
+            "=\"http://www.w3.org/ns/ttml\"",
+            "=\"http://www.w3.org/2004/11/ttaf1\"",
+            "=\"http://www.w3.org/2006/04/ttaf1\"",
+            "=\"http://www.w3.org/2006/10/ttaf1\"",
+        };
+        const char *psz_ns;
+        for( size_t i=0; i<ARRAY_SIZE(rgsz) && !psz_ns; i++ )
+        {
+            psz_ns = strnstr( psz_xml, rgsz[i],
+                              i_xml -( (ptrdiff_t)psz_tt - (ptrdiff_t)psz_xml ) );
+        }
         free( psz_alloc );
         if( !psz_ns )
             return VLC_EGENERIC;



More information about the vlc-commits mailing list