]> git.sesse.net Git - vlc/commitdiff
mms/tcp: hanging or unexpected seeking after the end of stream
authorbl4 <bl4@playker.info>
Sat, 24 May 2008 18:17:49 +0000 (20:17 +0200)
committerRafaël Carré <funman@videolan.org>
Mon, 26 May 2008 20:34:35 +0000 (22:34 +0200)
Signed-off-by: Rafaël Carré <funman@videolan.org>
modules/access/mms/mmstu.c
src/input/stream.c

index 7b417456a9e6fc0d0296a5c69c1a6f67b97ad52e..776f0c273d5fc78ac9c2ce3ab0386e40b77acc12 100644 (file)
@@ -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 *** */
index 228fb872a6fb7156aa8891a0070478d4d4b0fa69..94ec22479fe014cfa5e66265cd2cc10a7481fe82 100644 (file)
@@ -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