]> git.sesse.net Git - vlc/commitdiff
* stream.c: fixed a problem with peek.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 23 Jun 2004 20:42:07 +0000 (20:42 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 23 Jun 2004 20:42:07 +0000 (20:42 +0000)
src/input/stream.c

index a5e899a127831f1c828a0782c65d67e3c0684250..94855f85bea375a9efeb0abf1a3528b859c29ccc 100644 (file)
@@ -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 )
     {
-        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 )