Don't spuriously report that the current track has changed

Fixes the last track in the queue repeating forever
custom
jacqueline 8 months ago
parent ff7468635f
commit 326cc42a63
  1. 4
      src/tangara/audio/track_queue.cpp

@ -242,6 +242,8 @@ auto TrackQueue::next(Reason r) -> void {
{ {
const std::unique_lock<std::shared_mutex> lock(mutex_); const std::unique_lock<std::shared_mutex> lock(mutex_);
auto pos = position_;
if (shuffle_) { if (shuffle_) {
shuffle_->next(); shuffle_->next();
position_ = shuffle_->current(); position_ = shuffle_->current();
@ -250,7 +252,9 @@ auto TrackQueue::next(Reason r) -> void {
position_++; position_++;
} }
} }
goTo(position_); goTo(position_);
changed = pos != position_;
} }
notifyChanged(changed, r); notifyChanged(changed, r);

Loading…
Cancel
Save