summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-05 21:46:54 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-05-07 10:49:20 +0900
commitd723970279d44321ddf1c0cbcf49b4137dbfa5bc (patch)
tree5ff8ebd4b71ac72e49b5145de1ecd2a52e851740
parent0e3767227034aa2bf2094325cdd6394d193d8af7 (diff)
downloadmpv-d723970279d44321ddf1c0cbcf49b4137dbfa5bc.tar.bz2
mpv-d723970279d44321ddf1c0cbcf49b4137dbfa5bc.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. (cherry picked from commit 7a5f5a8adf5921ed8fcee29d76113d9a7f018974)
-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);