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();
pos_ = shuffle_->current();
} else {
pos_++;
if (pos_ >= tracks_.size() && repeat_) {
pos_ = 0;
if (pos_ + 1 >= tracks_.size()) {
if (repeat_) {
pos_ = 0;
}
} else {
pos_++;
}
}

Loading…
Cancel
Save