Commit ef17f9a4 authored by Bill C Riemers's avatar Bill C Riemers Committed by Rémi Denis-Courmont

access_http: do not close the stream when seeking out of range

+ minor simplifications
Signed-off-by: default avatarRémi Denis-Courmont <rdenis@simphalempin.com>
parent 09dce84e
...@@ -881,6 +881,17 @@ static int Seek( access_t *p_access, int64_t i_pos ) ...@@ -881,6 +881,17 @@ static int Seek( access_t *p_access, int64_t i_pos )
Disconnect( p_access ); 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 ) ) if( Connect( p_access, i_pos ) )
{ {
msg_Err( p_access, "seek failed" ); msg_Err( p_access, "seek failed" );
......
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