Changeset 3387


Ignore:
Timestamp:
Dec 6, 2010 4:25:44 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1160: Option to bypass RTP payload type verification in the stream (thanks Johan Lantz for the suggestion)

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/config.h

    r3345 r3387  
    503503#endif 
    504504 
     505/** 
     506 * Perform RTP payload type checking in the stream. Normally the peer 
     507 * MUST send RTP with payload type as we specified in our SDP. Certain 
     508 * agents may not be able to follow this hence the only way to have 
     509 * communication is to disable this check. 
     510 * 
     511 * Default: 1 
     512 */ 
     513#ifndef PJMEDIA_STREAM_CHECK_RTP_PT 
     514#   define PJMEDIA_STREAM_CHECK_RTP_PT          1 
     515#endif 
    505516 
    506517/** 
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r3313 r3387  
    15741574    unsigned payloadlen; 
    15751575    pjmedia_rtp_status seq_st; 
     1576    pj_bool_t check_pt; 
    15761577    pj_status_t status; 
    15771578    pj_bool_t pkt_discarded = PJ_FALSE; 
     
    16031604     * the incoming packet. 
    16041605     */ 
    1605     pjmedia_rtp_session_update2(&channel->rtp, hdr, &seq_st, 
    1606                                 hdr->pt != stream->rx_event_pt); 
     1606    check_pt = (hdr->pt != stream->rx_event_pt) && PJMEDIA_STREAM_CHECK_RTP_PT; 
     1607    pjmedia_rtp_session_update2(&channel->rtp, hdr, &seq_st, check_pt); 
     1608#if !PJMEDIA_STREAM_CHECK_RTP_PT 
     1609    if (!check_pt && hdr->pt != channel->rtp.out_pt && 
     1610        hdr->pt != stream->rx_event_pt) 
     1611    { 
     1612        seq_st.status.flag.badpt = 1; 
     1613    } 
     1614#endif 
    16071615    if (seq_st.status.value) { 
    16081616        TRC_  ((stream->port.info.name.ptr,  
Note: See TracChangeset for help on using the changeset viewer.