aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/pulseaudio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/backends/pulseaudio.cpp')
-rw-r--r--alc/backends/pulseaudio.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp
index 16a2450f..8c6cc4d3 100644
--- a/alc/backends/pulseaudio.cpp
+++ b/alc/backends/pulseaudio.cpp
@@ -452,11 +452,13 @@ struct MainloopUniqueLock : public std::unique_lock<PulseMainloop> {
if(eventFacility == PA_SUBSCRIPTION_EVENT_SINK
|| eventFacility == PA_SUBSCRIPTION_EVENT_SOURCE)
{
+ const auto deviceType = (eventFacility == PA_SUBSCRIPTION_EVENT_SINK)
+ ? alc::DeviceType::Playback : alc::DeviceType::Capture;
const auto eventType = (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK);
if(eventType == PA_SUBSCRIPTION_EVENT_NEW)
- alc::Event(alc::EventType::DeviceAdded, "Device added");
+ alc::Event(alc::EventType::DeviceAdded, deviceType, "Device added");
else if(eventType == PA_SUBSCRIPTION_EVENT_REMOVE)
- alc::Event(alc::EventType::DeviceRemoved, "Device removed");
+ alc::Event(alc::EventType::DeviceRemoved, deviceType, "Device removed");
}
};
pa_context_set_subscribe_callback(mutex()->mContext, handler, nullptr);