summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2022-09-01 10:39:27 +0200
committerPhilip Langdale <github.philipl@overt.org>2022-09-11 20:24:42 -0700
commit235a66bfc8a5341d0c40966b3746a97749b1c9a0 (patch)
tree6cfd2c11d39bab5c5c350badb82cafb1fc699b68 /audio
parent013ec877f6e0d2483a864e963d7f5ccfc1f31973 (diff)
downloadmpv-235a66bfc8a5341d0c40966b3746a97749b1c9a0.tar.bz2
mpv-235a66bfc8a5341d0c40966b3746a97749b1c9a0.tar.xz
audio: list devices for all AOs with hotplug_init
Previously we would only call list_devs() on available AOs if an AO *did not* have a hotplug_init() callback or for the first one that *did* have it. This is problematic when multiple fully functional hotplug-capable AOs are available. The second one would not be able to contribute discovered devices. This problem prevents ao_pipewire from introducing full hotplug support with hotplug_init().
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 4dddd7dc2b..397af50a78 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -532,10 +532,13 @@ struct ao_device_list *ao_hotplug_get_device_list(struct ao_hotplug *hp,
continue;
if (ao->driver->hotplug_init) {
- if (!hp->ao && ao->driver->hotplug_init(ao) >= 0)
- hp->ao = ao; // keep this one
- if (hp->ao && hp->ao->driver == d)
- get_devices(hp->ao, list);
+ if (ao->driver->hotplug_init(ao) >= 0) {
+ get_devices(ao, list);
+ if (hp->ao)
+ ao->driver->hotplug_uninit(ao);
+ else
+ hp->ao = ao; // keep this one
+ }
} else {
get_devices(ao, list);
}