Commit 77c069c6 authored by Laurent Aimar's avatar Laurent Aimar

Allow reading until the end of the file while discarding data.

It probably closes #2719.
parent 7d413c48
...@@ -1061,7 +1061,16 @@ static int AStreamReadStream( stream_t *s, void *p_read, unsigned int i_read ) ...@@ -1061,7 +1061,16 @@ static int AStreamReadStream( stream_t *s, void *p_read, unsigned int i_read )
bool b_aseek; bool b_aseek;
access_Control( p_access, ACCESS_CAN_SEEK, &b_aseek ); access_Control( p_access, ACCESS_CAN_SEEK, &b_aseek );
if( b_aseek ) if( b_aseek )
return AStreamSeekStream( s, p_sys->i_pos + i_read ) ? 0 : i_read; {
const int64_t i_pos_wanted = p_sys->i_pos + i_read;
if( AStreamSeekStream( s, i_pos_wanted ) )
{
if( p_sys->i_pos != i_pos_wanted )
return 0;
}
return i_read;
}
} }
#ifdef STREAM_DEBUG #ifdef STREAM_DEBUG
......
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