summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio_properties.c
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2015-02-03 00:28:54 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2015-02-03 00:40:02 +0100
commitde4f9977528e454c44f980a4364ecd18d3219c62 (patch)
tree323c54565b1ead914d59a4826f09b8cecccef91c /audio/out/ao_coreaudio_properties.c
parenta3be14683a33211e3e07094246bb3342fc789763 (diff)
downloadmpv-de4f9977528e454c44f980a4364ecd18d3219c62.tar.bz2
mpv-de4f9977528e454c44f980a4364ecd18d3219c62.tar.xz
ao_coreaudio: use device UID instead of ID for selection
Previously we let the user use the audio device ID, but this is not persistent and can change when plugging in new devices. That of course made it quite worthless for storing it as a user setting for GUIs, or for user scripts. In theory getting the kAudioDevicePropertyDeviceUID can fail but it doesn't on any of my devices, so I'm leaving the error reporting quite high and see if someone complains.
Diffstat (limited to 'audio/out/ao_coreaudio_properties.c')
-rw-r--r--audio/out/ao_coreaudio_properties.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/audio/out/ao_coreaudio_properties.c b/audio/out/ao_coreaudio_properties.c
index 181d338cbd..cf2b4d14a1 100644
--- a/audio/out/ao_coreaudio_properties.c
+++ b/audio/out/ao_coreaudio_properties.c
@@ -83,12 +83,7 @@ OSStatus ca_get_str(AudioObjectID id, ca_scope scope, ca_sel selector,
ca_get(id, scope, selector, sizeof(CFStringRef), (void **)&string);
CHECK_CA_ERROR_SILENT_L(coreaudio_error);
- CFIndex size =
- CFStringGetMaximumSizeForEncoding(
- CFStringGetLength(string), CA_CFSTR_ENCODING) + 1;
-
- *data = talloc_zero_size(NULL, size);
- CFStringGetCString(string, *data, size, CA_CFSTR_ENCODING);
+ *data = cfstr_get_cstr(string);
CFRelease(string);
coreaudio_error:
return err;