player/Thread: call DecoderCommand::SEEK only on existing decoder

If the decoder was just started, it already seeks to the desired
position.
This commit is contained in:
Max Kellermann 2015-11-05 00:41:54 +01:00
parent 30cad0c5f1
commit 3b71e2abef

View File

@ -575,6 +575,9 @@ Player::SeekDecoder()
/* re-start the decoder */
StartDecoder(*pipe);
ActivateDecoder();
if (!WaitDecoderStartup())
return false;
} else {
if (!IsDecoderAtCurrentSong()) {
/* the decoder is already decoding the "next" song,
@ -585,9 +588,10 @@ Player::SeekDecoder()
delete pc.next_song;
pc.next_song = nullptr;
queued = false;
}
/* wait for the decoder to complete initialization */
/* wait for the decoder to complete initialization
(just in case that happens to be still in
progress) */
if (!WaitDecoderStartup())
return false;
@ -608,6 +612,7 @@ Player::SeekDecoder()
}
elapsed_time = where;
}
pc.LockCommandFinished();