player/Thread: cancel outputs before seeking

.. instead of doing it after seeking.  After seeking, the command had
no effect, because CheckDecoderStartup() waits for all outputs to
finish.  This caused a very long delay while seeking and switching
songs (https://bugs.musicpd.org/view.php?id=4534).
This commit is contained in:
Max Kellermann 2016-06-13 09:13:56 +02:00
parent 75c8aecffa
commit 5771d67202
2 changed files with 3 additions and 2 deletions

1
NEWS
View File

@ -1,4 +1,5 @@
ver 0.19.16 (not yet released)
* faster seeking
* fix system include path order
* add missing DocBook file to tarball

View File

@ -518,6 +518,8 @@ Player::SeekDecoder()
{
assert(pc.next_song != nullptr);
pc.outputs.Cancel();
const SongTime start_time = pc.next_song->GetStartTime();
if (!dc.LockIsCurrentSong(*pc.next_song)) {
@ -583,8 +585,6 @@ Player::SeekDecoder()
/* re-fill the buffer after seeking */
buffering = true;
pc.outputs.Cancel();
return true;
}