[vlc-commits] demux: avi: fix non seekbable uncompressed bitmaps (fix #9192)

Francois Cartegnie git at videolan.org
Fri Apr 18 21:54:41 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr 18 21:51:50 2014 +0200| [149394aa908add5ef94723af410100f9b7d78cdd] | committer: Francois Cartegnie

demux: avi: fix non seekbable uncompressed bitmaps (fix #9192)

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

 modules/demux/avi/avi.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index ceb9519..d535861 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -228,7 +228,8 @@ static mtime_t  AVI_MovieGetLength( demux_t * );
 
 static void AVI_MetaLoad( demux_t *, avi_chunk_list_t *p_riff, avi_chunk_avih_t *p_avih );
 
-block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk, const int i_size );
+block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
+                     const int i_header, const int i_size );
 
 /*****************************************************************************
  * Stream management
@@ -827,13 +828,12 @@ static void Close ( vlc_object_t * p_this )
  * ReadFrame: Reads frame, using stride if necessary
  *****************************************************************************/
 
-block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk, const int i_size )
+block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
+                     const int i_header, const int i_size )
 {
     block_t *p_frame = stream_Block( p_demux->s, __EVEN( i_size ) );
     if ( !p_frame ) return p_frame;
 
-    const uint8_t i_header = ( tk->i_idxposb == 0 ) ? 8 : 0;
-
     if( i_size % 2 )    /* read was padded on word boundary */
     {
         p_frame->i_buffer--;
@@ -1186,7 +1186,8 @@ static int Demux_Seekable( demux_t *p_demux )
             i_size += 8; /* need to read and skip header */
         }
 
-        if( ( p_frame = ReadFrame( p_demux, tk, i_size ) )==NULL )
+        if( ( p_frame = ReadFrame( p_demux, tk,
+                        ( tk->i_idxposb == 0 ) ? 8 : 0, i_size ) )==NULL )
         {
             msg_Warn( p_demux, "failed reading data" );
             tk->b_eof = false;
@@ -1356,8 +1357,8 @@ static int Demux_UnSeekable( demux_t *p_demux )
                         AVI_GetPTS( p_stream_master ) )< 600*1000 )
             {
                 /* load it and send to decoder */
-                block_t *p_frame;
-                if( AVI_PacketRead( p_demux, &avi_pk, &p_frame ) || p_frame == NULL )
+                block_t *p_frame = ReadFrame( p_demux, p_stream, 8, avi_pk.i_size + 8 ) ;
+                if( p_frame == NULL )
                 {
                     return( -1 );
                 }



More information about the vlc-commits mailing list