]> git.sesse.net Git - vlc/commitdiff
* One more fix for vobsubs with negative times
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 21 Jan 2006 20:38:05 +0000 (20:38 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 21 Jan 2006 20:38:05 +0000 (20:38 +0000)
modules/demux/vobsub.c

index 4cf4a227930a92336c15901316ed80be3db799ce..ce0b29019b251c32d4595da4ec527da28dfc221b 100644 (file)
@@ -582,7 +582,11 @@ static int ParseVobSubIDX( demux_t *p_demux )
             {
                 subtitle_t *current_sub;
 
-                if( line[count-3] == '-' ) i_sign = -1;
+                if( line[count-3] == '-' )
+                {
+                    i_sign = -1;
+                    h = -h;
+                }
                 i_start = (int64_t) ( h * 3600*1000 +
                             m * 60*1000 +
                             s * 1000 +
@@ -612,7 +616,11 @@ static int ParseVobSubIDX( demux_t *p_demux )
             if( sscanf( line, "delay: %d%n:%d:%d:%d",
                         &h, &count, &m, &s, &ms ) >= 4 )
             {
-                if( line[count-3] == '-' ) i_sign = -1;
+                if( line[count-3] == '-' )
+                {
+                    i_sign = -1;
+                    h = -h;
+                }
                 i_gap = (int64_t) ( h * 3600*1000 +
                             m * 60*1000 +
                             s * 1000 +