Commit bc6924d3 authored by Max Kellermann's avatar Max Kellermann

output/snapcast: fix busy loop while paused

Removing the LockHasClients(); this code was copied from the "httpd" output plugin, but unlike "httpd", the SnapCast output plugin does not feed silence while paused, so we need to implement a delay to avoid busy-looping the CPU. As a side effect, this eliminates the suttering after resuming playback, because the timer now gets reset even if there is a client. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1394
parent 02b00f91
...@@ -5,6 +5,8 @@ ver 0.23.8 (not yet released) ...@@ -5,6 +5,8 @@ ver 0.23.8 (not yet released)
- cdio_paranoia: fix crash if no drive was found - cdio_paranoia: fix crash if no drive was found
- cdio_paranoia: faster cancellation - cdio_paranoia: faster cancellation
- cdio_paranoia: don't scan for replay gain tags - cdio_paranoia: don't scan for replay gain tags
- snapcast: fix busy loop while paused
- snapcast: fix stuttering after resuming playback
* mixer * mixer
- better error messages - better error messages
- alsa: fix setting volume before playback starts - alsa: fix setting volume before playback starts
......
...@@ -214,9 +214,8 @@ SnapcastOutput::RemoveClient(SnapcastClient &client) noexcept ...@@ -214,9 +214,8 @@ SnapcastOutput::RemoveClient(SnapcastClient &client) noexcept
std::chrono::steady_clock::duration std::chrono::steady_clock::duration
SnapcastOutput::Delay() const noexcept SnapcastOutput::Delay() const noexcept
{ {
if (!LockHasClients() && pause) { if (pause) {
/* if there's no client and this output is paused, /* Pause() will not do anything, it will not fill
then Pause() will not do anything, it will not fill
the buffer and it will not update the timer; the buffer and it will not update the timer;
therefore, we reset the timer here */ therefore, we reset the timer here */
timer->Reset(); timer->Reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment