Changeset 4610 for pjproject/trunk
- Timestamp:
- Oct 3, 2013 10:26:14 AM (11 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_info.c
r4537 r4610 58 58 59 59 #if defined(PJ_DARWINOS) && PJ_DARWINOS != 0 && TARGET_OS_IPHONE 60 # include <sys/types.h> 61 # include <sys/sysctl.h> 60 62 void pj_iphone_os_get_sys_info(pj_sys_info *si, pj_str_t *si_buffer); 61 63 #endif … … 152 154 { 153 155 pj_str_t buf = {si_buffer + PJ_SYS_INFO_BUFFER_SIZE - left, left}; 154 pj_str_t machine = {"arm ", 3};156 pj_str_t machine = {"arm-", 4}; 155 157 pj_str_t sdk_name = {"iOS-SDK", 7}; 158 size_t size = PJ_SYS_INFO_BUFFER_SIZE - machine.slen; 156 159 char tmp[PJ_SYS_INFO_BUFFER_SIZE]; 157 160 int name[] = {CTL_HW,HW_MACHINE}; 161 158 162 pj_iphone_os_get_sys_info(&si, &buf); 159 163 left -= si.os_name.slen + 1; 160 164 161 165 si.os_ver = parse_version(si.machine.ptr); 162 163 si.machine = machine; 166 167 pj_memcpy(tmp, machine.ptr, machine.slen); 168 sysctl(name, 2, tmp+machine.slen, &size, NULL, 0); 169 ALLOC_CP_STR(tmp, machine); 164 170 si.sdk_name = sdk_name; 165 171 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r4555 r4610 310 310 PJ_DEF(void) pjsua_media_config_default(pjsua_media_config *cfg) 311 311 { 312 const pj_sys_info *si = pj_get_sys_info(); 313 pj_str_t dev_model = {"iPhone5", 7}; 314 312 315 pj_bzero(cfg, sizeof(*cfg)); 313 316 314 317 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 } 316 329 cfg->channel_count = 1; 317 330 cfg->audio_frame_ptime = PJSUA_DEFAULT_AUDIO_FRAME_PTIME;
Note: See TracChangeset
for help on using the changeset viewer.