demux: avi:fix block reading
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 18 Sep 2014 21:25:23 +0000 (23:25 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 22 Sep 2014 18:20:05 +0000 (20:20 +0200)
modules/demux/avi/avi.c

index b04e966..2d16936 100644 (file)
@@ -1027,10 +1027,12 @@ static int Demux_Seekable( demux_t *p_demux )
         {
             toread[i_track].i_toread = AVI_PTSToByte( tk, i_dpts );
         }
-        else
+        else if ( i_dpts > -2 * CLOCK_FREQ ) /* don't send a too early dts (low fps video) */
         {
             toread[i_track].i_toread = AVI_PTSToChunk( tk, i_dpts );
         }
+        else
+            toread[i_track].i_toread = -1;
     }
 
     for( ;; )
@@ -1052,7 +1054,7 @@ static int Demux_Seekable( demux_t *p_demux )
                 continue;
             }
 
-            if( toread[i].i_toread > 0 )
+            if( toread[i].i_toread >= 0 )
             {
                 b_done = false; /* not yet finished */
             }