Commit fc9f8518 authored by bl4's avatar bl4 Committed by Rafaël Carré

mms/tcp: hanging or unexpected seeking after the end of stream

Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent c865a653
......@@ -400,6 +400,11 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
size_t i_data;
size_t i_copy;
if( p_access->info.b_eof )
{
return 0;
}
i_data = 0;
/* *** now send data if needed *** */
......
......@@ -1025,11 +1025,16 @@ static int AStreamReadStream( stream_t *s, void *p_read, int i_read )
/* seek within this stream if possible, else use plain old read and discard */
stream_sys_t *p_sys = s->p_sys;
access_t *p_access = p_sys->p_access;
/* seeking after EOF is not what we want */
if( !( p_access->info.b_eof ) )
{
bool b_aseek;
access_Control( p_access, ACCESS_CAN_SEEK, &b_aseek );
if( b_aseek )
return AStreamSeekStream( s, p_sys->i_pos + i_read ) ? 0 : i_read;
}
}
#ifdef STREAM_DEBUG
msg_Dbg( s, "AStreamReadStream: %d pos=%"PRId64" tk=%d start=%"PRId64
......
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