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
This commit is contained in:
parent
02b00f9146
commit
bc6924d303
2
NEWS
2
NEWS
|
@ -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
|
||||||
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();
|
||||||
|
|
Loading…
Reference in New Issue