Commit 5bac9731 authored by Laurent Aimar's avatar Laurent Aimar

Fixed skipping data until EOF while using block access.

parent 66ee062c
...@@ -960,17 +960,18 @@ static int AStreamSeekBlock( stream_t *s, int64_t i_pos ) ...@@ -960,17 +960,18 @@ static int AStreamSeekBlock( stream_t *s, int64_t i_pos )
{ {
do do
{ {
/* Read and skip enough data */
if( AStreamRefillBlock( s ) )
return VLC_EGENERIC;
while( p_sys->block.p_current && while( p_sys->block.p_current &&
p_sys->i_pos + p_sys->block.p_current->i_buffer - p_sys->block.i_offset < i_pos ) p_sys->i_pos + p_sys->block.p_current->i_buffer - p_sys->block.i_offset <= i_pos )
{ {
p_sys->i_pos += p_sys->block.p_current->i_buffer - p_sys->block.i_offset; p_sys->i_pos += p_sys->block.p_current->i_buffer - p_sys->block.i_offset;
p_sys->block.p_current = p_sys->block.p_current->p_next; p_sys->block.p_current = p_sys->block.p_current->p_next;
p_sys->block.i_offset = 0; p_sys->block.i_offset = 0;
} }
if( !p_sys->block.p_current && AStreamRefillBlock( s ) )
{
if( p_sys->i_pos != i_pos )
return VLC_EGENERIC;
}
} }
while( p_sys->block.i_start + p_sys->block.i_size < i_pos ); while( p_sys->block.i_start + p_sys->block.i_size < i_pos );
......
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