Changeset 31456021a2949b237406f493fce2a5a015c19f57

Show
Ignore:
Timestamp:
10/02/07 14:38:42 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1171114722 +0000
git-parent:

[97577c7bc51823c4c2447011a0d1a678bce39e7c]

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

Force RTP for UDP-Lite, as we have no legacy issue (suggestion from Md)

Files:

Legend:

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

    r7605da8 r3145602  
    9696    add_shortcut( "rtp6" ); 
    9797    add_shortcut( "udplite" ); 
    98     add_shortcut( "rtplite" ); 
    9998 
    10099    set_callbacks( Open, Close ); 
     
    137136    const char *psz_server_addr, *psz_bind_addr = ""; 
    138137    int  i_bind_port, i_server_port = 0; 
    139     int fam = AF_UNSPEC, proto = IPPROTO_UDP, cscov = 8
     138    int fam = AF_UNSPEC, proto = IPPROTO_UDP
    140139 
    141140    if (strlen (p_access->psz_access) >= 3) 
     
    153152        if (strcmp (p_access->psz_access + 3, "lite") == 0) 
    154153            proto = IPPROTO_UDPLITE; 
    155    } 
    156    if (strncmp (p_access->psz_access, "rtp", 3) == 0) 
    157         /* Checksum coverage: RTP header is AT LEAST 12 bytes 
    158          * in addition to UDP header (8 bytes) */ 
    159         cscov += 12; 
     154    } 
    160155 
    161156    i_bind_port = var_CreateGetInteger( p_access, "server-port" ); 
     
    223218#ifdef UDPLITE_RECV_CSCOV 
    224219    if (proto == IPPROTO_UDPLITE) 
    225         setsockopt (p_sys->fd, SOL_UDPLITE, UDPLITE_RECV_CSCOV, &cscov, sizeof (cscov)); 
     220        /* UDP header: 8 bytes + RTP header: 12 bytes (or more) */ 
     221        setsockopt (p_sys->fd, SOL_UDPLITE, UDPLITE_RECV_CSCOV, 
     222                    &(int){ 20 }, sizeof (int)); 
    226223#endif 
    227224 
  • modules/access_output/udp.c

    rce6dbc6 r3145602  
    118118    add_shortcut( "rtp" ); // Will work only with ts muxer 
    119119    add_shortcut( "udplite" ); 
    120     add_shortcut( "rtplite" ); 
    121120    set_callbacks( Open, Close ); 
    122121vlc_module_end(); 
     
    206205                       ppsz_core_options, p_access->p_cfg ); 
    207206 
    208     if( !( p_sys = malloc( sizeof( sout_access_out_sys_t ) ) ) ) 
     207    if( !( p_sys = calloc ( 1, sizeof( sout_access_out_sys_t ) ) ) ) 
    209208    { 
    210209        msg_Err( p_access, "not enough memory" ); 
    211210        return VLC_EGENERIC; 
    212211    } 
    213     memset( p_sys, 0, sizeof(sout_access_out_sys_t) ); 
    214212    p_access->p_sys = p_sys; 
    215213 
    216214    if( p_access->psz_access != NULL ) 
    217215    { 
    218         if (strncmp (p_access->psz_access, "rtp", 3) == 0) 
    219         { 
    220             p_sys->b_rtpts = 1; 
    221             cscov += RTP_HEADER_LENGTH; 
    222         } 
    223         if ((strlen (p_access->psz_access) >= 3) 
    224          && (strcmp (p_access->psz_access + 3, "lite") == 0)) 
     216        if (strcmp (p_access->psz_access, "rtp") == 0) 
     217            p_sys->b_rtpts = VLC_TRUE; 
     218        if (strcmp (p_access->psz_access, "udplite") == 0) 
     219        { 
     220            protoname = "UDP-Lite"; 
    225221            proto = IPPROTO_UDPLITE; 
    226     } 
     222            p_sys->b_rtpts = VLC_TRUE; 
     223        } 
     224    } 
     225    if (p_sys->b_rtpts) 
     226        cscov += RTP_HEADER_LENGTH; 
    227227 
    228228    psz_parser = strdup( p_access->psz_name ); 
     
    271271    if( i_handle == -1 ) 
    272272    { 
    273          msg_Err( p_access, "failed to create UDP socket" ); 
     273         msg_Err( p_access, "failed to create %s socket", protoname ); 
    274274         return VLC_EGENERIC; 
    275275    } 
     
    311311    p_access->pf_seek = Seek; 
    312312 
    313     msg_Dbg( p_access, "udp access output opened(%s:%d)", 
    314              psz_dst_addr, i_dst_port ); 
     313    msg_Dbg( p_access, "%s access output opened(%s:%d)", 
     314             protoname, psz_dst_addr, i_dst_port ); 
    315315 
    316316    free( psz_dst_addr ); 
     
    355355    p_access->p_sout->i_out_pace_nocontrol--; 
    356356 
    357     msg_Dbg( p_access, "udp access output closed" ); 
     357    msg_Dbg( p_access, "UDP access output closed" ); 
    358358    free( p_sys ); 
    359359} 
     
    384384            if( p_sys->p_buffer->i_dts + p_sys->p_thread->i_caching < mdate() ) 
    385385            { 
    386                 msg_Dbg( p_access, "late packet for udp input (" I64Fd ")", 
     386                msg_Dbg( p_access, "late packet for UDP input (" I64Fd ")", 
    387387                         mdate() - p_sys->p_buffer->i_dts 
    388388                          - p_sys->p_thread->i_caching );