Changeset 2328


Ignore:
Timestamp:
Sep 27, 2008 11:50:17 AM (11 years ago)
Author:
nanang
Message:

Fixed possible assertion by codec when stereo/multichannel codec is used and stream is about to send keep-NAT-alive packet (thanks Bill Gardner for the patch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r2317 r2328  
    180180 
    181181/* Zero audio frame samples */ 
    182 static pj_int16_t zero_frame[30 * 16000 / 1000]; 
     182static pj_int16_t zero_frame[2 * 30 * 16000 / 1000]; 
    183183 
    184184/* 
     
    756756               (stream->dir & PJMEDIA_DIR_ENCODING) && 
    757757               stream->codec_param.info.frm_ptime * 
    758                 stream->codec_param.info.clock_rate/1000 < 
     758               stream->codec_param.info.channel_cnt * 
     759               stream->codec_param.info.clock_rate/1000 < 
    759760                  PJ_ARRAY_SIZE(zero_frame))  
    760761    { 
     
    764765        silence_frame.buf = zero_frame; 
    765766        silence_frame.size = stream->codec_param.info.frm_ptime * 2 * 
    766                               stream->codec_param.info.clock_rate / 1000; 
     767                             stream->codec_param.info.channel_cnt * 
     768                             stream->codec_param.info.clock_rate / 1000; 
    767769        silence_frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 
    768770        silence_frame.timestamp.u32.lo = pj_ntohl(stream->enc->rtp.out_hdr.ts); 
Note: See TracChangeset for help on using the changeset viewer.