[vlc-devel] commit: mms/tcp: hanging or unexpected seeking after the end of stream ( bl4 )
git version control
git at videolan.org
Mon May 26 22:44:02 CEST 2008
vlc | branch: master | bl4 <bl4 at playker.info> | Sat May 24 20:17:49 2008 +0200| [fc9f851816aa9d98dfbc84c8ffee4a00d58d4e6b]
mms/tcp: hanging or unexpected seeking after the end of stream
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc9f851816aa9d98dfbc84c8ffee4a00d58d4e6b
---
modules/access/mms/mmstu.c | 5 +++++
src/input/stream.c | 13 +++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 7b41745..776f0c2 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -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 *** */
diff --git a/src/input/stream.c b/src/input/stream.c
index 228fb87..94ec224 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -1025,10 +1025,15 @@ 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;
- 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;
+
+ /* 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
More information about the vlc-devel
mailing list