Ignore:
Timestamp:
Oct 3, 2013 10:26:14 AM (11 years ago)
Author:
ming
Message:

Re #1697: Add device info in pj_get_sys_info() and set default clock rate for iPhone 5 running iOS7 to 44100Hz

File:
1 edited

Legend:

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

    r4555 r4610  
    310310PJ_DEF(void) pjsua_media_config_default(pjsua_media_config *cfg) 
    311311{ 
     312    const pj_sys_info *si = pj_get_sys_info(); 
     313    pj_str_t dev_model = {"iPhone5", 7}; 
     314     
    312315    pj_bzero(cfg, sizeof(*cfg)); 
    313316 
    314317    cfg->clock_rate = PJSUA_DEFAULT_CLOCK_RATE; 
    315     cfg->snd_clock_rate = 0; 
     318    /* It is reported that there may be some media server resampling problem 
     319     * with iPhone 5 devices running iOS 7, so we set the sound device's 
     320     * clock rate to 44100 to avoid resampling. 
     321     */ 
     322    if (pj_stristr(&si->machine, &dev_model) && 
     323        ((si->os_ver & 0xFF000000) >> 24) >= 7) 
     324    { 
     325        cfg->snd_clock_rate = 44100; 
     326    } else { 
     327        cfg->snd_clock_rate = 0; 
     328    } 
    316329    cfg->channel_count = 1; 
    317330    cfg->audio_frame_ptime = PJSUA_DEFAULT_AUDIO_FRAME_PTIME; 
Note: See TracChangeset for help on using the changeset viewer.