From d723970279d44321ddf1c0cbcf49b4137dbfa5bc Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 5 May 2015 21:46:54 +0200 Subject: ao_coreaudio_utils: unbreak default device selection It appears this is the reason coreaudio-exclusive does not work without explicitly specifying a device, even if the default device maps to something passthrough-capable. (cherry picked from commit 7a5f5a8adf5921ed8fcee29d76113d9a7f018974) --- audio/out/ao_coreaudio_utils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index fbb336149d..716f0df5e3 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -88,7 +88,7 @@ OSStatus ca_select_device(struct ao *ao, char* name, AudioDeviceID *device) OSStatus err = noErr; *device = kAudioObjectUnknown; - if (name) { + if (name && name[0]) { CFStringRef uid = cfstr_from_cstr(name); AudioValueTranslation v = (AudioValueTranslation) { .mInputData = &uid, @@ -116,9 +116,8 @@ OSStatus ca_select_device(struct ao *ao, char* name, AudioDeviceID *device) if (mp_msg_test(ao->log, MSGL_V)) { char *desc; - err = CA_GET_STR(*device, kAudioObjectPropertyName, &desc); - CHECK_CA_WARN("could not get selected audio device name"); - if (err == noErr) { + OSStatus err2 = CA_GET_STR(*device, kAudioObjectPropertyName, &desc); + if (err2 == noErr) { MP_VERBOSE(ao, "selected audio output device: %s (%" PRIu32 ")\n", desc, *device); talloc_free(desc); -- cgit v1.2.3