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.
Showing the changes to TOOLS/lua/audio-hotplug-test.lua (1 of 6 files). Show all
Unified · Split
| @@ -6,3 +6,8 @@ mp.observe_property("audio-device-list", "native", function(name, val) · 5 unmodified lines | ||
| 6 | 6 | print(" - '" .. e.name .. "' (" .. e.description .. ")") |
| 7 | 7 | end |
| 8 | 8 | end) |
| 9 | + | |
| 10 | +mp.observe_property("audio-out-detected-device", "native", function(name, val) | |
| 11 | + print("Detected audio device changed:") | |
| 12 | + print(" - '" .. val) | |
| 13 | +end) | |