- Timestamp:
- Jan 13, 2011 4:42:21 PM (14 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia-audiodev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c
r3403 r3404 418 418 return PJMEDIA_EAUD_INIT; 419 419 } 420 421 if (dev_size > 1) { 422 AudioDeviceID dev_id = kAudioObjectUnknown; 423 unsigned idx = 0; 424 425 /* Find default audio input device */ 426 addr.mSelector = kAudioHardwarePropertyDefaultInputDevice; 427 addr.mScope = kAudioObjectPropertyScopeGlobal; 428 addr.mElement = kAudioObjectPropertyElementMaster; 429 size = sizeof(dev_id); 430 431 ostatus = AudioObjectGetPropertyData(kAudioObjectSystemObject, 432 &addr, 0, NULL, 433 &size, (void *)&dev_id); 434 if (ostatus != noErr && dev_id != dev_ids[idx]) { 435 AudioDeviceID temp_id = dev_ids[idx]; 436 437 for (i = idx + 1; i < dev_size; i++) { 438 if (dev_ids[i] == dev_id) { 439 dev_ids[idx++] = dev_id; 440 dev_ids[i] = temp_id; 441 break; 442 } 443 } 444 } 445 446 /* Find default audio output device */ 447 addr.mSelector = kAudioHardwarePropertyDefaultOutputDevice; 448 ostatus = AudioObjectGetPropertyData(kAudioObjectSystemObject, 449 &addr, 0, NULL, 450 &size, (void *)&dev_id); 451 if (ostatus != noErr && dev_id != dev_ids[idx]) { 452 AudioDeviceID temp_id = dev_ids[idx]; 453 454 for (i = idx + 1; i < dev_size; i++) { 455 if (dev_ids[i] == dev_id) { 456 dev_ids[idx] = dev_id; 457 dev_ids[i] = temp_id; 458 break; 459 } 460 } 461 } 462 } 420 463 421 464 /* Build the devices' info */ … … 650 693 if (strm->rec_thread_initialized == 0 || !pj_thread_is_registered()) 651 694 { 695 pj_bzero(strm->rec_thread_desc, sizeof(pj_thread_desc)); 652 696 status = pj_thread_register("ca_rec", strm->rec_thread_desc, 653 697 &strm->rec_thread); … … 790 834 if (strm->rec_thread_initialized == 0 || !pj_thread_is_registered()) 791 835 { 836 pj_bzero(strm->rec_thread_desc, sizeof(pj_thread_desc)); 792 837 status = pj_thread_register("ca_rec", strm->rec_thread_desc, 793 838 &strm->rec_thread); … … 905 950 if (stream->play_thread_initialized == 0 || !pj_thread_is_registered()) 906 951 { 952 pj_bzero(stream->play_thread_desc, sizeof(pj_thread_desc)); 907 953 status = pj_thread_register("coreaudio", stream->play_thread_desc, 908 954 &stream->play_thread); -
pjproject/trunk/pjmedia/src/pjmedia-audiodev/pa_dev.c
r3058 r3404 186 186 if (stream->rec_thread_initialized == 0 || !pj_thread_is_registered()) 187 187 { 188 pj_bzero(stream->rec_thread_desc, sizeof(pj_thread_desc)); 188 189 status = pj_thread_register("pa_rec", stream->rec_thread_desc, 189 190 &stream->rec_thread); … … 298 299 if (stream->play_thread_initialized == 0 || !pj_thread_is_registered()) 299 300 { 301 pj_bzero(stream->play_thread_desc, sizeof(pj_thread_desc)); 300 302 status = pj_thread_register("portaudio", stream->play_thread_desc, 301 303 &stream->play_thread);
Note: See TracChangeset
for help on using the changeset viewer.