player/Thread: call OnPlayerSync() in SeekDecoder()
This fixes a spurious "single" mode bug which occurs when using "play" or "seek" to start playback on the song that is currently paused: in that case, the main thread never queues the next song, and at the end of the song, the player thread exits Run(), stopping playback, and after that, the main thread starts the next song without considering "single" mode. By calling OnPlayerSync(), we ensure that the main thread gets a chance to queue the next song before the player thread exits the Run() loop. Closes https://github.com/MusicPlayerDaemon/MPD/issues/850
This commit is contained in:
@@ -681,6 +681,12 @@ Player::SeekDecoder() noexcept
|
||||
/* re-fill the buffer after seeking */
|
||||
buffering = true;
|
||||
|
||||
{
|
||||
/* call syncPlaylistWithQueue() in the main thread */
|
||||
const ScopeUnlock unlock(pc.mutex);
|
||||
pc.listener.OnPlayerSync();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user