Changeset 7e0739c6760ea31e4f624c3f779884d65169d6e5

Show
Ignore:
Timestamp:
27/09/07 18:03:56 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1190909036 +0000
git-parent:

[b6d069b38b19d45885dd1d9a8ff4bd3abe8897a6]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1190909036 +0000
Message:

Detect EOF for datagram connection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/udp.c

    r5e7a421 r7e0739c  
    110110    int fd; 
    111111 
    112     vlc_bool_t b_framed_rtp
     112    vlc_bool_t b_framed_rtp, b_comedia
    113113 
    114114    /* reorder rtp packets when out-of-sequence */ 
     
    224224            p_sys->fd = net_ConnectTCP( p_access, psz_server_addr, i_server_port ); 
    225225            p_access->pf_block = BlockRTP; 
    226             p_sys->b_framed_rtp = VLC_TRUE; 
     226            p_sys->b_comedia = p_sys->b_framed_rtp = VLC_TRUE; 
    227227            break; 
    228228 
     
    235235            msg_Err( p_access, "DCCP support not compiled-in!" ); 
    236236#endif 
     237            p_sys->b_comedia = VLC_TRUE; 
    237238            break; 
    238239    } 
     
    326327    block_t      *p_block; 
    327328 
     329    if( p_access->info.b_eof ) 
     330        return NULL; 
     331 
    328332    /* Read data */ 
    329333    p_block = block_New( p_access, MTU ); 
    330334    p_block->i_buffer = net_Read( p_access, p_sys->fd, NULL, 
    331335                                  p_block->p_buffer, MTU, VLC_FALSE ); 
    332     if( p_block->i_buffer < 0 ) 
    333     { 
     336    if( ( p_block->i_buffer < 0 ) 
     337     || ( p_sys->b_comedia && ( p_block->i_buffer == 0 ) ) ) 
     338    { 
     339        if( p_sys->b_comedia ) 
     340        { 
     341            p_access->info.b_eof = VLC_TRUE; 
     342            msg_Dbg( p_access, "connection-oriented media hangup" ); 
     343        } 
    334344        block_Release( p_block ); 
    335345        return NULL;