player/Thread: merge two mutex locks

This commit is contained in:
Max Kellermann 2017-12-22 00:42:10 +01:00
parent 4bcc38c749
commit ea8ab4ddf2
1 changed files with 3 additions and 3 deletions

View File

@ -610,6 +610,8 @@ Player::SeekDecoder() noexcept
ClearAndReplacePipe(dc.pipe);
}
const std::lock_guard<Mutex> lock(pc.mutex);
const SongTime start_time = pc.next_song->GetStartTime();
pc.next_song.reset();
queued = false;
@ -618,7 +620,7 @@ Player::SeekDecoder() noexcept
(just in case that happens to be still in
progress) */
if (!LockWaitDecoderStartup())
if (!WaitDecoderStartup())
return false;
/* send the SEEK command */
@ -630,8 +632,6 @@ Player::SeekDecoder() noexcept
where = total_time;
}
const std::lock_guard<Mutex> lock(pc.mutex);
try {
const PlayerControl::ScopeOccupied occupied(pc);