aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx
index b81ca4246..4a4ca433c 100644
--- a/src/mixer/AlsaMixerPlugin.cxx
+++ b/src/mixer/AlsaMixerPlugin.cxx
@@ -47,10 +47,22 @@ class AlsaMixerMonitor final : private MultiSocketMonitor {
public:
AlsaMixerMonitor(EventLoop &_loop, snd_mixer_t *_mixer)
:MultiSocketMonitor(_loop), mixer(_mixer) {
- BlockingCall(_loop, [this](){ InvalidateSockets(); });
+#ifdef USE_EPOLL
+ _loop.AddCall([this](){ InvalidateSockets(); });
+#else
+ _loop.AddIdle(InitAlsaMixerMonitor, this);
+#endif
}
private:
+#ifndef USE_EPOLL
+ static gboolean InitAlsaMixerMonitor(gpointer data) {
+ AlsaMixerMonitor &amm = *(AlsaMixerMonitor *)data;
+ amm.InvalidateSockets();
+ return false;
+ }
+#endif
+
virtual int PrepareSockets() override;
virtual void DispatchSockets() override;
};