Commit ea8ab4dd authored by Max Kellermann's avatar Max Kellermann

player/Thread: merge two mutex locks

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