Ignore:
Timestamp:
Dec 7, 2011 5:19:34 AM (12 years ago)
Author:
bennylp
Message:

Fixed #1421 (Audio is missing temporarily if SRTP is enabled due to lock codec feature). The problem occured because when lock codec is called, the stream may not transmit any RTP packets yet, causing the RTCP statistic to return zero as the last RTP sequence number sent. The zero RTP sequence number would cause SRTP to refuse to encode the RTP packet with error replay status

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/src/pjmedia/stream.c

    r3868 r3900  
    926926        void *rtcp_pkt; 
    927927        int len; 
     928        pj_status_t status; 
    928929 
    929930        pjmedia_rtcp_build_rtcp(&stream->rtcp, &rtcp_pkt, &len); 
    930931 
    931         pjmedia_transport_send_rtcp(stream->transport, rtcp_pkt, len); 
     932        status=pjmedia_transport_send_rtcp(stream->transport, rtcp_pkt, len); 
     933        if (status != PJ_SUCCESS) { 
     934            PJ_PERROR(4,(stream->port.info.name.ptr, status, 
     935                         "Error sending RTCP")); 
     936        } 
    932937 
    933938        stream->rtcp_last_tx = timestamp; 
     
    13391344 
    13401345    /* Send the RTP packet to the transport. */ 
    1341     pjmedia_transport_send_rtp(stream->transport, channel->out_pkt,  
    1342                                frame_out.size + sizeof(pjmedia_rtp_hdr)); 
     1346    status = pjmedia_transport_send_rtp(stream->transport, channel->out_pkt, 
     1347                                        frame_out.size + 
     1348                                            sizeof(pjmedia_rtp_hdr)); 
     1349    if (status != PJ_SUCCESS) { 
     1350        PJ_PERROR(4,(stream->port.info.name.ptr, status, 
     1351                     "Error sending RTP")); 
     1352    } 
    13431353 
    13441354    /* Update stat */ 
     
    18401850                pkt += len; 
    18411851                len = ((pj_uint8_t*)pkt) - ((pj_uint8_t*)stream->enc->out_pkt); 
    1842                 pjmedia_transport_send_rtcp(stream->transport,  
    1843                                             stream->enc->out_pkt, len); 
     1852                status = pjmedia_transport_send_rtcp(stream->transport, 
     1853                                                     stream->enc->out_pkt, 
     1854                                                     len); 
     1855                if (status != PJ_SUCCESS) { 
     1856                    PJ_PERROR(4,(stream->port.info.name.ptr, status, 
     1857                                 "Error sending RTCP SDES")); 
     1858                } 
    18441859            } 
    18451860        } else { 
    1846             pjmedia_transport_send_rtcp(stream->transport, sr_rr_pkt, len); 
     1861            status = pjmedia_transport_send_rtcp(stream->transport, 
     1862                                                 sr_rr_pkt, len); 
     1863            if (status != PJ_SUCCESS) { 
     1864                PJ_PERROR(4,(stream->port.info.name.ptr, status, 
     1865                             "Error sending initial RTCP RR")); 
     1866            } 
    18471867        } 
    18481868 
     
    22502270 
    22512271        pjmedia_rtcp_init2(&stream->rtcp, &rtcp_setting); 
     2272 
     2273        if (info->rtp_seq_ts_set) { 
     2274            stream->rtcp.stat.rtp_tx_last_seq = info->rtp_seq; 
     2275            stream->rtcp.stat.rtp_tx_last_ts = info->rtp_ts; 
     2276        } 
    22522277    } 
    22532278 
Note: See TracChangeset for help on using the changeset viewer.