Fix bug where calling TrackQueue's next() repeatedly would increase the position despite running off the end of the queue.

custom
Robin Howard 1 year ago committed by Robin Howard
parent 3f1fadbeef
commit 429abd1237
  1. 9
      src/audio/track_queue.cpp

@ -200,9 +200,12 @@ auto TrackQueue::next() -> void {
shuffle_->next(); shuffle_->next();
pos_ = shuffle_->current(); pos_ = shuffle_->current();
} else { } else {
pos_++; if (pos_ + 1 >= tracks_.size()) {
if (pos_ >= tracks_.size() && repeat_) { if (repeat_) {
pos_ = 0; pos_ = 0;
}
} else {
pos_++;
} }
} }

Loading…
Cancel
Save