summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio_utils.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-05 21:46:54 +0200
committerwm4 <wm4@nowhere>2015-05-05 21:46:54 +0200
commit7a5f5a8adf5921ed8fcee29d76113d9a7f018974 (patch)
treea3b7018824f14720184219eb4fcb9a8bade0089d /audio/out/ao_coreaudio_utils.c
parentbbedceb467033b239b35ee9b2db963a93d8a57c9 (diff)
downloadmpv-7a5f5a8adf5921ed8fcee29d76113d9a7f018974.tar.bz2
mpv-7a5f5a8adf5921ed8fcee29d76113d9a7f018974.tar.xz
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.
Diffstat (limited to 'audio/out/ao_coreaudio_utils.c')
-rw-r--r--audio/out/ao_coreaudio_utils.c7
1 files 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);