Changeset 3415


Ignore:
Timestamp:
Feb 17, 2011 3:59:52 PM (14 years ago)
Author:
nanang
Message:

Misc (re #1175): fix sample app pcaputil.c bug, it always fails in reading the first/reference packet when the codec is not PCMU (default payload type was hardcoded to zero/PCMU).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/pcaputil.c

    r2394 r3415  
    121121                     pjmedia_rtp_hdr **rtp, 
    122122                     pj_uint8_t **payload, 
    123                      unsigned *payload_size) 
     123                     unsigned *payload_size, 
     124                     pj_bool_t check_pt) 
    124125{ 
    125126    pj_status_t status; 
     
    183184 
    184185        /* Update RTP session */ 
    185         pjmedia_rtp_session_update(&app.rtp_sess, r, &seq_st); 
     186        pjmedia_rtp_session_update2(&app.rtp_sess, r, &seq_st, PJ_FALSE); 
    186187 
    187188        /* Skip out-of-order packet */ 
     
    192193 
    193194        /* Skip if payload type is different */ 
    194         if (r->pt != app.pt) { 
     195        if (check_pt && r->pt != app.pt) { 
    195196            printf("Skipping RTP packet with bad payload type\n"); 
    196197            continue; 
     
    271272    /* Read first packet */ 
    272273    read_rtp(pkt0.buffer, sizeof(pkt0.buffer), &pkt0.rtp,  
    273              &pkt0.payload, &pkt0.payload_len); 
     274             &pkt0.payload, &pkt0.payload_len, PJ_FALSE); 
    274275 
    275276    cmgr = pjmedia_endpt_get_codec_mgr(app.mept); 
     
    326327        /* Read next packet */ 
    327328        read_rtp(pkt1.buffer, sizeof(pkt1.buffer), &pkt1.rtp, 
    328                  &pkt1.payload, &pkt1.payload_len); 
     329                 &pkt1.payload, &pkt1.payload_len, PJ_TRUE); 
    329330 
    330331        /* Fill in the gap (if any) between pkt0 and pkt1 */ 
Note: See TracChangeset for help on using the changeset viewer.