diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_coreaudio_utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index b073cd6d8a..8d85842dfd 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -28,6 +28,16 @@ #include "osdep/endian.h" #include "audio/format.h" +static bool ca_is_output_device(struct ao *ao, AudioDeviceID dev) +{ + size_t n_buffers; + AudioBufferList *buffers; + const ca_scope scope = kAudioDevicePropertyStreamConfiguration; + CA_GET_ARY_O(dev, scope, &buffers, &n_buffers); + talloc_free(buffers); + return n_buffers > 0; +} + void ca_get_device_list(struct ao *ao, struct ao_device_list *list) { AudioDeviceID *devs; @@ -37,6 +47,8 @@ void ca_get_device_list(struct ao *ao, struct ao_device_list *list) &devs, &n_devs); CHECK_CA_ERROR("Failed to get list of output devices."); for (int i = 0; i < n_devs; i++) { + if (!ca_is_output_device(ao, devs[i])) + continue; char name[32]; char *desc; sprintf(name, "%d", devs[i]); |