From: Bill C Riemers Date: Mon, 16 Jun 2008 15:46:47 +0000 (-0400) Subject: access_http: do not close the stream when seeking out of range X-Git-Tag: 0.9.0-test1~260 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ef17f9a4277e587c586307550029e3a912fdcf95;p=vlc access_http: do not close the stream when seeking out of range + minor simplifications Signed-off-by: RĂ©mi Denis-Courmont --- diff --git a/modules/access/http.c b/modules/access/http.c index 2b7768ab6b..f7a2995d5a 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -881,6 +881,17 @@ static int Seek( access_t *p_access, int64_t i_pos ) Disconnect( p_access ); + if( p_access->info.i_size + && (uint64_t)i_pos >= (uint64_t)p_access->info.i_size ) { + msg_Err( p_access, "seek to far" ); + int retval = Seek( p_access, p_access->info.i_size - 1 ); + if( retval == VLC_SUCCESS ) { + uint8_t p_buffer[2]; + Read( p_access, p_buffer, 1); + p_access->info.b_eof = false; + } + return retval; + } if( Connect( p_access, i_pos ) ) { msg_Err( p_access, "seek failed" );