diff options
author | Liong Sauw Ming <ming@teluu.com> | 2013-10-03 10:26:14 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2013-10-03 10:26:14 +0000 |
commit | 5732af557fb9dee021bb3f8996954682b410aaca (patch) | |
tree | dff688a924b00b9aefa0a93d0a8a371bb0a4a871 /pjsip | |
parent | 420902fd4b501515600a6971c5b895d44121124c (diff) |
Re #1697: Add device info in pj_get_sys_info() and set default clock rate for iPhone 5 running iOS7 to 44100Hz
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4610 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_core.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index d170b664..bc0cc406 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -309,10 +309,23 @@ PJ_DEF(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg) PJ_DEF(void) pjsua_media_config_default(pjsua_media_config *cfg) { + const pj_sys_info *si = pj_get_sys_info(); + pj_str_t dev_model = {"iPhone5", 7}; + pj_bzero(cfg, sizeof(*cfg)); cfg->clock_rate = PJSUA_DEFAULT_CLOCK_RATE; - cfg->snd_clock_rate = 0; + /* It is reported that there may be some media server resampling problem + * with iPhone 5 devices running iOS 7, so we set the sound device's + * clock rate to 44100 to avoid resampling. + */ + if (pj_stristr(&si->machine, &dev_model) && + ((si->os_ver & 0xFF000000) >> 24) >= 7) + { + cfg->snd_clock_rate = 44100; + } else { + cfg->snd_clock_rate = 0; + } cfg->channel_count = 1; cfg->audio_frame_ptime = PJSUA_DEFAULT_AUDIO_FRAME_PTIME; cfg->max_media_ports = PJSUA_MAX_CONF_PORTS; |