diff --git a/src/audio/track_queue.cpp b/src/audio/track_queue.cpp index 5ac9d1f8..c4c101f6 100644 --- a/src/audio/track_queue.cpp +++ b/src/audio/track_queue.cpp @@ -318,10 +318,12 @@ auto TrackQueue::repeat() const -> bool { } auto TrackQueue::replay(bool en) -> void { - const std::unique_lock lock(mutex_); - replay_ = en; - if (shuffle_) { - shuffle_->replay(en); + { + const std::unique_lock lock(mutex_); + replay_ = en; + if (shuffle_) { + shuffle_->replay(en); + } } notifyChanged(false); }