diff options
author | Max Kellermann <max@duempel.org> | 2015-01-04 19:42:15 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-04 19:51:09 +0100 |
commit | f532964fdea5bfd69aabb2fc35a41f631a46abce (patch) | |
tree | 147b100d5dfc0733ed84af558fdfe5a58e726147 /src | |
parent | efea609dc328a0a17bdec11586bb54041981ff62 (diff) | |
download | mpd-f532964fdea5bfd69aabb2fc35a41f631a46abce.tar.gz mpd-f532964fdea5bfd69aabb2fc35a41f631a46abce.tar.xz mpd-f532964fdea5bfd69aabb2fc35a41f631a46abce.zip |
output/pulse: add wrapper for pa_threaded_mainloop_signal()
Diffstat (limited to 'src')
-rw-r--r-- | src/output/plugins/PulseOutputPlugin.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index 158b36dfd..8ad885f82 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -92,7 +92,7 @@ public: void OnStreamWrite(size_t nbytes); void OnStreamSuccess() { - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); } gcc_const @@ -136,6 +136,10 @@ private: */ void DeleteContext(); + void Signal() { + pa_threaded_mainloop_signal(mainloop, 0); + } + /** * Check if the context is (already) connected, and waits if * not. If the context has been disconnected, retry to @@ -299,7 +303,7 @@ PulseOutput::OnContextStateChanged(pa_context_state_t new_state) if (mixer != nullptr) pulse_mixer_on_connect(*mixer, context); - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); break; case PA_CONTEXT_TERMINATED: @@ -309,7 +313,7 @@ PulseOutput::OnContextStateChanged(pa_context_state_t new_state) /* the caller thread might be waiting for these states */ - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); break; case PA_CONTEXT_UNCONNECTED: @@ -549,7 +553,7 @@ PulseOutput::OnStreamSuspended(gcc_unused pa_stream *_stream) /* wake up the main loop to break out of the loop in pulse_output_play() */ - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); } static void @@ -573,7 +577,7 @@ PulseOutput::OnStreamStateChanged(pa_stream *_stream, if (mixer != nullptr) pulse_mixer_on_change(*mixer, context, _stream); - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); break; case PA_STREAM_FAILED: @@ -581,7 +585,7 @@ PulseOutput::OnStreamStateChanged(pa_stream *_stream, if (mixer != nullptr) pulse_mixer_on_disconnect(*mixer); - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); break; case PA_STREAM_UNCONNECTED: @@ -604,7 +608,7 @@ PulseOutput::OnStreamWrite(size_t nbytes) assert(mainloop != nullptr); writable = nbytes; - pa_threaded_mainloop_signal(mainloop, 0); + Signal(); } static void |