[vlc-commits] demux: ttml: update time expression format strings

Francois Cartegnie git at videolan.org
Thu Nov 16 10:54:28 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 16 10:50:55 2017 +0100| [c9d3821d7f100663669508fe89fb61d98e2cb8f4] | committer: Francois Cartegnie

demux: ttml: update time expression format strings

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

 modules/codec/ttml/ttml.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/codec/ttml/ttml.c b/modules/codec/ttml/ttml.c
index 8df1a7e354..fa8bf307ae 100644
--- a/modules/codec/ttml/ttml.c
+++ b/modules/codec/ttml/ttml.c
@@ -87,10 +87,10 @@ static tt_time_t tt_ParseTime( const char *s )
     char c = 0;
 
     /* Clock time */
-    if( sscanf( s, "%u:%u:%u%c%u",     &h1, &m1, &s1, &c, &d1 ) == 5 ||
-                         tt_ScanReset( &h1, &m1, &s1, &c, &d1 )      ||
-        sscanf( s, "%u:%u:%u",         &h1, &m1, &s1          ) == 3 ||
-                         tt_ScanReset( &h1, &m1, &s1, &c, &d1 ) )
+    if( sscanf( s, "%u:%2u:%2u%c%u",     &h1, &m1, &s1, &c, &d1 ) == 5 ||
+                           tt_ScanReset( &h1, &m1, &s1, &c, &d1 )      ||
+        sscanf( s, "%u:%2u:%2u",         &h1, &m1, &s1          ) == 3 ||
+                           tt_ScanReset( &h1, &m1, &s1, &c, &d1 ) )
     {
         t.base = CLOCK_FREQ * (h1 * 3600 + m1 * 60 + s1);
         if( c == '.' && d1 > 0 )



More information about the vlc-commits mailing list