diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-02-14 12:43:55 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-02-14 12:51:15 +0100 |
commit | 70802d519f9130696959346aa413f7faeeed7621 (patch) | |
tree | 130639c7880b1495b2b43d31480705733989c899 /audio/out/ao.c | |
parent | 9aaec7cffb2fb1543d4c3cabb55165f606c0b87d (diff) | |
download | mpv-70802d519f9130696959346aa413f7faeeed7621.tar.bz2 mpv-70802d519f9130696959346aa413f7faeeed7621.tar.xz |
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.
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r-- | audio/out/ao.c | 10 |
1 files changed, 5 insertions, 5 deletions
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) { |