diff --git a/src/tangara/audio/track_queue.cpp b/src/tangara/audio/track_queue.cpp index 5689ecf0..0db507f7 100644 --- a/src/tangara/audio/track_queue.cpp +++ b/src/tangara/audio/track_queue.cpp @@ -46,6 +46,9 @@ RandomIterator::RandomIterator(size_t size) } auto RandomIterator::current() const -> size_t { + if (size_ == 0) { + return 0; + } return MillerShuffle(pos_, seed_, size_); } @@ -191,7 +194,7 @@ auto TrackQueue::append(Item i) -> void { bool current_changed; { const std::shared_lock lock(mutex_); - was_queue_empty = playlist_.currentPosition() >= playlist_.size(); + was_queue_empty = currentPosition() >= totalSize(); current_changed = was_queue_empty; // Dont support inserts yet }