player/Thread: drain outputs at end of song in "single" mode

Without this, the Pause() call would drop the ring buffers and would
skip a considerable portion of the end of the song.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/824
This commit is contained in:
Max Kellermann 2020-04-14 16:03:49 +02:00
parent 8d2079482f
commit 32a5bf043b
2 changed files with 8 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.21.23 (not yet released)
* player
- drain outputs at end of song in "single" mode
ver 0.21.22 (2020/04/02)
* database

View File

@ -964,6 +964,12 @@ Player::SongBorder() noexcept
if (border_pause) {
paused = true;
pc.listener.OnBorderPause();
/* drain all outputs to guarantee the current song is
really being played to the end; without this, the
Pause() call would drop all ring buffers */
pc.outputs.Drain();
pc.outputs.Pause();
idle_add(IDLE_PLAYER);
}