From c482de120b992a1c7d6f84a94c90d1b3314327f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Wed, 27 Feb 2008 19:46:31 +0000 Subject: [PATCH] fix #1404 --- src/input/stream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/input/stream.c b/src/input/stream.c index 34bc4760c8..8449a09faf 100644 --- a/src/input/stream.c +++ b/src/input/stream.c @@ -730,8 +730,8 @@ static int AStreamReadBlock( stream_t *s, void *p_read, int i_read ) p_sys->block.i_offset = 0; p_sys->block.p_current = p_sys->block.p_current->p_next; } - /*Get a new block */ - if( AStreamRefillBlock( s ) ) + /*Get a new block if needed */ + if( !p_sys->block.p_current && AStreamRefillBlock( s ) ) { break; } @@ -915,13 +915,13 @@ 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 ) + while( p_sys->block.i_start + p_sys->block.i_size < i_pos ) { 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 < i_pos ) { p_sys->i_pos += p_sys->block.p_current->i_buffer; p_sys->block.p_current = p_sys->block.p_current->p_next; -- 2.39.2