Commit d0194a6f authored by Max Kellermann's avatar Max Kellermann

decoder/Control: caller must lock mutex for Seek()

parent e45d13d4
...@@ -128,8 +128,6 @@ DecoderControl::Stop() noexcept ...@@ -128,8 +128,6 @@ DecoderControl::Stop() noexcept
void void
DecoderControl::Seek(SongTime t) DecoderControl::Seek(SongTime t)
{ {
const std::lock_guard<Mutex> protect(mutex);
assert(state != DecoderState::START); assert(state != DecoderState::START);
assert(state != DecoderState::ERROR); assert(state != DecoderState::ERROR);
......
...@@ -387,6 +387,8 @@ public: ...@@ -387,6 +387,8 @@ public:
/** /**
* Throws #std::runtime_error on error. * Throws #std::runtime_error on error.
*
* Caller must lock the object.
*/ */
void Seek(SongTime t); void Seek(SongTime t);
......
...@@ -628,6 +628,7 @@ Player::SeekDecoder() noexcept ...@@ -628,6 +628,7 @@ Player::SeekDecoder() noexcept
try { try {
const PlayerControl::ScopeOccupied occupied(pc); const PlayerControl::ScopeOccupied occupied(pc);
const std::lock_guard<Mutex> lock(pc.mutex);
dc.Seek(where + start_time); dc.Seek(where + start_time);
} catch (...) { } catch (...) {
/* decoder failure */ /* decoder failure */
......
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