Commit cb669602 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: avi: fix non seekable streams

parent 1491773b
......@@ -705,13 +705,16 @@ aviindex:
{
AVI_IndexCreate( p_demux );
}
else if( p_sys->b_seekable )
{
AVI_IndexLoad( p_demux );
}
else
{
msg_Warn( p_demux, "cannot create index (unseekable stream)" );
AVI_IndexLoad( p_demux );
}
}
else
else if( p_sys->b_seekable )
{
AVI_IndexLoad( p_demux );
}
......@@ -877,11 +880,8 @@ block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
}
/* skip header */
if( tk->i_idxposb == 0 )
{
p_frame->p_buffer += i_header;
p_frame->i_buffer -= i_header;
}
p_frame->p_buffer += i_header;
p_frame->i_buffer -= i_header;
if ( !tk->i_width_bytes )
return p_frame;
......@@ -1181,7 +1181,14 @@ static int Demux_Seekable( demux_t *p_demux )
}
else
{
stream_Seek( p_demux->s, i_pos );
if( !p_sys->b_fastseekable && (i_pos > stream_Tell( p_demux->s )) )
{
stream_Read( p_demux->s, NULL, i_pos - stream_Tell( p_demux->s ) );
}
else
{
stream_Seek( p_demux->s, i_pos );
}
}
/* Set the track to use */
......
......@@ -152,11 +152,10 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
if( p_container->common.i_chunk_fourcc == AVIFOURCC_LIST &&
p_container->list.i_type == AVIFOURCC_movi )
{
if( !b_seekable )
return VLC_SUCCESS;
msg_Dbg( (vlc_object_t*)s, "skipping movi chunk" );
if( b_seekable )
return AVI_NextChunk( s, p_container );
else
return VLC_EGENERIC; /* point at begining of LIST-movi */
return AVI_NextChunk( s, p_container ); /* points at begining of LIST-movi if not seekable */
}
if( stream_Read( s, NULL, 12 ) != 12 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment