player/Thread: merge two mutex locks

This commit is contained in:
Max Kellermann 2017-12-22 00:39:54 +01:00
parent d0194a6fb3
commit 5becffbba5
1 changed files with 2 additions and 2 deletions

View File

@ -625,14 +625,14 @@ Player::SeekDecoder() noexcept
where = total_time;
}
const std::lock_guard<Mutex> lock(pc.mutex);
try {
const PlayerControl::ScopeOccupied occupied(pc);
const std::lock_guard<Mutex> lock(pc.mutex);
dc.Seek(where + start_time);
} catch (...) {
/* decoder failure */
const std::lock_guard<Mutex> lock(pc.mutex);
pc.SetError(PlayerError::DECODER,
std::current_exception());
pc.CommandFinished();