Changeset 4328 for pjproject/trunk


Ignore:
Timestamp:
Jan 23, 2013 1:40:04 AM (12 years ago)
Author:
ming
Message:

Re #1586: Fixed samples_per_frame calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c

    r4293 r4328  
    620620    /* Setup encoder control for encoding process */ 
    621621    silk->enc_ready = PJ_TRUE; 
    622     silk->samples_per_frame = attr->setting.frm_per_pkt * FRAME_LENGTH_MS * 
     622    silk->samples_per_frame = FRAME_LENGTH_MS * 
    623623                              attr->info.clock_rate / 1000; 
    624624    silk->pcm_bytes_per_sample = attr->info.pcm_bits_per_sample / 8; 
     
    626626    silk->enc_ctl.API_sampleRate        = attr->info.clock_rate; 
    627627    silk->enc_ctl.maxInternalSampleRate = attr->info.clock_rate; 
    628     silk->enc_ctl.packetSize            = silk->samples_per_frame; 
     628    silk->enc_ctl.packetSize            = attr->setting.frm_per_pkt * 
     629                                          silk->samples_per_frame; 
    629630    /* For useInBandFEC setting to be useful, we need to set 
    630631     * packetLossPercentage greater than LBRR_LOSS_THRES (1) 
     
    722723    /* Check frame in size */ 
    723724    nsamples = input->size >> 1; 
    724     PJ_ASSERT_RETURN(nsamples == silk->samples_per_frame,  
     725    PJ_ASSERT_RETURN(nsamples % silk->samples_per_frame == 0, 
    725726                     PJMEDIA_CODEC_EPCMFRMINLEN); 
    726727 
Note: See TracChangeset for help on using the changeset viewer.