Commit 0e65cf69 authored by Laurent Aimar's avatar Laurent Aimar

* stream.c: fixed a problem with peek.

parent a77fa520
...@@ -860,7 +860,13 @@ static int AStreamPeekStream( stream_t *s, uint8_t **pp_peek, int i_read ) ...@@ -860,7 +860,13 @@ static int AStreamPeekStream( stream_t *s, uint8_t **pp_peek, int i_read )
while( tk->i_end - tk->i_start - p_sys->stream.i_offset < i_read ) while( tk->i_end - tk->i_start - p_sys->stream.i_offset < i_read )
{ {
if( AStreamRefillStream( s ) ) break; if( p_sys->stream.i_used <= 1 )
{
/* Be sure we will read something */
p_sys->stream.i_used += i_read - (tk->i_end - tk->i_start - p_sys->stream.i_offset);
}
if( AStreamRefillStream( s ) )
break;
} }
if( tk->i_end - tk->i_start - p_sys->stream.i_offset < i_read ) if( tk->i_end - tk->i_start - p_sys->stream.i_offset < i_read )
......
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