Changeset 1047


Ignore:
Timestamp:
Mar 7, 2007 11:22:14 AM (13 years ago)
Author:
bennylp
Message:

Fixed ticket #163: Bug in pjmedia_stream_resume() not resuming the stream (thanks PurnaChandar? and Carmine)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/pjproject-0.5-stable/pjmedia/src/pjmedia/stream.c

    r974 r1047  
    918918    } 
    919919 
     920    /* Ignore keep-alive packets */ 
     921    if (bytes_read < sizeof(pjmedia_rtp_hdr)) 
     922        return; 
     923 
    920924    /* Update RTP and RTCP session. */ 
    921925    status = pjmedia_rtp_decode_rtp(&channel->rtp, pkt, bytes_read, 
     
    932936                        pj_ntohl(hdr->ts), payloadlen); 
    933937 
     938    /* Ignore the packet if decoder is paused */ 
     939    if (channel->paused) 
     940        return; 
     941 
    934942    /* Handle incoming DTMF. */ 
    935943    if (hdr->pt == stream->rx_event_pt) { 
     
    937945        return; 
    938946    } 
    939  
    940947 
    941948    /* Update RTP session (also checks if RTP session can accept 
     
    14741481    if ((dir & PJMEDIA_DIR_DECODING) && stream->dec) { 
    14751482        stream->dec->paused = 1; 
     1483 
     1484        /* Also reset jitter buffer */ 
     1485        pj_mutex_lock( stream->jb_mutex ); 
     1486        pjmedia_jbuf_reset(stream->jb); 
     1487        pj_mutex_unlock( stream->jb_mutex ); 
     1488 
    14761489        PJ_LOG(4,(stream->port.info.name.ptr, "Decoder stream paused")); 
    14771490    } 
     
    14901503 
    14911504    if ((dir & PJMEDIA_DIR_ENCODING) && stream->enc) { 
    1492         stream->enc->paused = 1; 
     1505        stream->enc->paused = 0; 
    14931506        PJ_LOG(4,(stream->port.info.name.ptr, "Encoder stream resumed")); 
    14941507    } 
    14951508 
    14961509    if ((dir & PJMEDIA_DIR_DECODING) && stream->dec) { 
    1497         stream->dec->paused = 1; 
     1510        stream->dec->paused = 0; 
    14981511        PJ_LOG(4,(stream->port.info.name.ptr, "Decoder stream resumed")); 
    14991512    } 
Note: See TracChangeset for help on using the changeset viewer.