[vlc-commits] demux: avi:fix block reading

Francois Cartegnie git at videolan.org
Mon Sep 22 23:43:55 CEST 2014


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 18 23:25:23 2014 +0200| [62dc2df2401d59148074fe930864a00104e87052] | committer: Jean-Baptiste Kempf

demux: avi:fix block reading

(cherry picked from commit d4c5f2dcd6a2df117b18422e2c50691e48be9707)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/avi/avi.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 3c213e7..989c111 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -1027,7 +1027,7 @@ static int Demux_Seekable( demux_t *p_demux )
         {
             toread[i_track].i_toread = AVI_PTSToByte( tk, llabs( 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, llabs( i_dpts ) );
         }
@@ -1036,6 +1036,8 @@ static int Demux_Seekable( demux_t *p_demux )
         {
             toread[i_track].i_toread *= -1;
         }
+        else
+            toread[i_track].i_toread = -1;
     }
 
     for( ;; )
@@ -1057,7 +1059,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 */
             }



More information about the vlc-commits mailing list