From 70802d519f9130696959346aa413f7faeeed7621 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 14 Feb 2015 12:43:55 +0100 Subject: ao_coreaudio: add support for hotplug notifications This commit adds notifications for hot plugging of devices. It also extends the old behaviour of the `audio-out-detected-device` property which is now backed by the hotplugging code. This allows clients to be notified when the actual audio output device changes. Maybe hotplugging should be supported for ao_coreaudio_exclusive too, but it's device selection code is a bit fragile. --- audio/out/ao.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'audio/out/ao.c') diff --git a/audio/out/ao.c b/audio/out/ao.c index a2fa2fb104..c7065f386a 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -450,11 +450,6 @@ bool ao_untimed(struct ao *ao) return ao->untimed; } -const char *ao_get_detected_device(struct ao *ao) -{ - return ao->detected_device; -} - // --- struct ao_hotplug { @@ -502,6 +497,11 @@ bool ao_hotplug_check_update(struct ao_hotplug *hp) return false; } +const char *ao_hotplug_get_detected_device(struct ao_hotplug *hp) +{ + return hp->ao->detected_device; +} + // The return value is valid until the next call to this API. struct ao_device_list *ao_hotplug_get_device_list(struct ao_hotplug *hp) { -- cgit v1.2.3