Changeset 5174


Ignore:
Timestamp:
Sep 10, 2015 7:17:22 AM (9 years ago)
Author:
nanang
Message:

Fix #1884: Fixed silence frame length in stream (frame length calculation didn't include frame per packet).

File:
1 edited

Legend:

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

    r5101 r5174  
    12691269               stream->port.info.fmt.id == PJMEDIA_FORMAT_L16 && 
    12701270               (stream->dir & PJMEDIA_DIR_ENCODING) && 
    1271                stream->codec_param.info.frm_ptime * 
    1272                stream->codec_param.info.channel_cnt * 
    1273                stream->codec_param.info.clock_rate/1000 < 
    1274                   PJ_ARRAY_SIZE(zero_frame)) 
     1271               stream->enc_samples_per_pkt < PJ_ARRAY_SIZE(zero_frame)) 
    12751272    { 
    12761273        pjmedia_frame silence_frame; 
     
    12781275        pj_bzero(&silence_frame, sizeof(silence_frame)); 
    12791276        silence_frame.buf = zero_frame; 
    1280         silence_frame.size = stream->codec_param.info.frm_ptime * 2 * 
    1281                              stream->codec_param.info.channel_cnt * 
    1282                              stream->codec_param.info.clock_rate / 1000; 
     1277        silence_frame.size = stream->enc_samples_per_pkt * 2; 
    12831278        silence_frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 
    12841279        silence_frame.timestamp.u32.lo = pj_ntohl(stream->enc->rtp.out_hdr.ts); 
Note: See TracChangeset for help on using the changeset viewer.