]> git.sesse.net Git - vlc/commitdiff
Mark EOF in case of connection-orinted RTP transport
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 13 Feb 2007 19:51:07 +0000 (19:51 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 13 Feb 2007 19:51:07 +0000 (19:51 +0000)
modules/access/udp.c

index 54ed20d514ff4b4be09e3e4e9c3f8abccd2941f7..803aabdf421995c23c7c50bbc0233c751786b517 100644 (file)
@@ -360,7 +360,9 @@ static block_t *BlockTCP( access_t *p_access )
 {
     access_sys_t *p_sys = p_access->p_sys;
     block_t      *p_block = p_sys->p_partial_frame;
-    int i_read;
+
+    if( p_access->info.b_eof )
+        return NULL;
 
     if( p_block == NULL )
     {
@@ -374,9 +376,9 @@ static block_t *BlockTCP( access_t *p_access )
     if (p_block->i_buffer < 2)
     {
         /* FIXME: not very efficient */
-        i_read = net_Read( p_access, p_sys->fd, NULL,
-                           p_block->p_buffer + p_block->i_buffer,
-                           2 - p_block->i_buffer, VLC_FALSE );
+        int i_read = net_Read( p_access, p_sys->fd, NULL,
+                               p_block->p_buffer + p_block->i_buffer,
+                               2 - p_block->i_buffer, VLC_FALSE );
         if( i_read <= 0 )
             goto error;
 
@@ -389,9 +391,9 @@ static block_t *BlockTCP( access_t *p_access )
     /* Read RTP frame */
     if( framelen > 0 )
     {
-        i_read = net_Read( p_access, p_sys->fd, NULL,
-                           p_block->p_buffer + p_block->i_buffer,
-                           2 + framelen - p_block->i_buffer, VLC_FALSE );
+        int i_read = net_Read( p_access, p_sys->fd, NULL,
+                               p_block->p_buffer + p_block->i_buffer,
+                               2 + framelen - p_block->i_buffer, VLC_FALSE );
         if( i_read <= 0 )
             goto error;
 
@@ -408,6 +410,7 @@ static block_t *BlockTCP( access_t *p_access )
     return p_block;
 
 error:
+    p_access->info.b_eof = VLC_TRUE;
     block_Release( p_block );
     p_sys->p_partial_frame = NULL;
     return NULL;