Changeset 2229 for pjproject/trunk


Ignore:
Timestamp:
Aug 21, 2008 3:04:20 PM (16 years ago)
Author:
nanang
Message:

Fixed pjsua-lib bug that it failed to connect sound device & conference for some audio_frame_ptime settings (thanks Thomas Ramp).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r2225 r2229  
    21282128    for (i=0; i<PJ_ARRAY_SIZE(clock_rates); ++i) { 
    21292129        char errmsg[PJ_ERR_MSG_SIZE]; 
    2130         unsigned fps; 
     2130        unsigned samples_per_frame; 
    21312131 
    21322132        PJ_LOG(4,(THIS_FILE,  
     
    21342134                  "@%d Hz", clock_rates[i])); 
    21352135 
     2136        samples_per_frame = clock_rates[i] * 
     2137                            pjsua_var.media_cfg.audio_frame_ptime * 
     2138                            pjsua_var.media_cfg.channel_count / 1000; 
     2139 
    21362140        /* Create the sound device. Sound port will start immediately. */ 
    2137         fps = 1000 / pjsua_var.media_cfg.audio_frame_ptime; 
    21382141        status = pjmedia_snd_port_create(pjsua_var.snd_pool, capture_dev, 
    21392142                                         playback_dev,  
    21402143                                         clock_rates[i],  
    21412144                                         pjsua_var.media_cfg.channel_count, 
    2142                                          clock_rates[i]/fps *  
    2143                                          pjsua_var.media_cfg.channel_count, 
     2145                                         samples_per_frame, 
    21442146                                         16, 0, &pjsua_var.snd_port); 
    21452147 
Note: See TracChangeset for help on using the changeset viewer.