]> granicus.if.org Git - libass/commitdiff
Interpret timestamps with negative components more obviously
authorOleg Oshmyan <chortos@inbox.lv>
Thu, 29 Oct 2015 00:56:14 +0000 (02:56 +0200)
committerOleg Oshmyan <chortos@inbox.lv>
Thu, 29 Oct 2015 01:00:50 +0000 (03:00 +0200)
Keep all components signed, allowing for timestamps like 00:01:-05.00
to denote 55 seconds. This matches the behavior of VSFilter.

libass/ass.c

index 094cc9202fa90fad16aadb04c8751c4f31be6264..1a2a3644dfea5222505a8f0481e813081b4c467c 100644 (file)
@@ -224,9 +224,9 @@ static void set_default_style(ASS_Style *style)
 
 static long long string2timecode(ASS_Library *library, char *p)
 {
-    unsigned h, m, s, ms;
+    int h, m, s, ms;
     long long tm;
-    int res = sscanf(p, "%u:%u:%u.%u", &h, &m, &s, &ms);
+    int res = sscanf(p, "%d:%d:%d.%d", &h, &m, &s, &ms);
     if (res < 4) {
         ass_msg(library, MSGL_WARN, "Bad timestamp");
         return 0;