Commit 3b71e2ab authored by Max Kellermann's avatar Max Kellermann

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

If the decoder was just started, it already seeks to the desired position.
parent 30cad0c5
...@@ -575,6 +575,9 @@ Player::SeekDecoder() ...@@ -575,6 +575,9 @@ Player::SeekDecoder()
/* re-start the decoder */ /* re-start the decoder */
StartDecoder(*pipe); StartDecoder(*pipe);
ActivateDecoder(); ActivateDecoder();
if (!WaitDecoderStartup())
return false;
} else { } else {
if (!IsDecoderAtCurrentSong()) { if (!IsDecoderAtCurrentSong()) {
/* the decoder is already decoding the "next" song, /* the decoder is already decoding the "next" song,
...@@ -585,9 +588,10 @@ Player::SeekDecoder() ...@@ -585,9 +588,10 @@ Player::SeekDecoder()
delete pc.next_song; delete pc.next_song;
pc.next_song = nullptr; pc.next_song = nullptr;
queued = false; 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()) if (!WaitDecoderStartup())
return false; return false;
...@@ -608,6 +612,7 @@ Player::SeekDecoder() ...@@ -608,6 +612,7 @@ Player::SeekDecoder()
} }
elapsed_time = where; elapsed_time = where;
}
pc.LockCommandFinished(); pc.LockCommandFinished();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment