Commit ac217da0 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Fixed AStreamSeekBlock. When skipping data, the position may not be the

requested one. (Breaking at least mapped file input).
parent 58766eae
......@@ -995,19 +995,21 @@ static int AStreamSeekBlock( stream_t *s, int64_t i_pos )
}
else
{
/* Read enough data */
while( p_sys->block.i_start + p_sys->block.i_size < i_pos )
do
{
/* Read and skip enough data */
if( AStreamRefillBlock( s ) )
return VLC_EGENERIC;
while( p_sys->block.p_current &&
p_sys->i_pos + p_sys->block.p_current->i_buffer < 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->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.i_offset = 0;
}
}
while( p_sys->block.i_start + p_sys->block.i_size < i_pos );
p_sys->block.i_offset = i_pos - p_sys->i_pos;
p_sys->i_pos = i_pos;
......
Supports Markdown
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