[vlc-commits] ttml : Add ss.dd time format support

Stanislas PLessia git at videolan.org
Tue Jul 26 18:34:30 CEST 2016


vlc | branch: master | Stanislas PLessia <stplessia at gmail.com> | Tue Jul 26 14:58:44 2016 +0200| [bc98dce5f58a8bf1e7cd56430ad2bad2ee945122] | committer: Hugo Beauzée-Luyssen

ttml : Add ss.dd time format support

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/demux/ttml.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 1a5c1b5..83ca86e 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -159,10 +159,14 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
 
 static int Convert_time( int64_t *timing_value, const char *s )
 {
-    int h1, m1, s1, d1 = 0;
+    int h1 = 0;
+    int m1 = 0;
+    int s1 = 0;
+    int d1 = 0;
     //char *sec = "";
-
-    if ( sscanf( s, "%d:%d:%d,%d",
+    if ( sscanf( s, "%d.%ds",
+                 &s1, &d1) == 2 ||
+	 sscanf( s, "%d:%d:%d,%d",
                  &h1, &m1, &s1, &d1 ) == 4 ||
          sscanf( s, "%d:%d:%d.%d",
                  &h1, &m1, &s1, &d1 ) == 4 ||



More information about the vlc-commits mailing list