diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-12-30 11:04:03 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-12-30 11:04:03 +1100 |
| commit | dac29bf98632bb4450932b06e12328af48f1bb9e (patch) | |
| tree | 0d03b91a5079f5a28e1a873b816d86c2fc0288cf /src/tangara/audio/track_queue.cpp | |
| parent | ae6746fc950415512ce8a625762e01d99694291c (diff) | |
| download | tangara-fw-dac29bf98632bb4450932b06e12328af48f1bb9e.tar.gz | |
Fix issue with playlists restarting playback after enqueuing
Diffstat (limited to 'src/tangara/audio/track_queue.cpp')
| -rw-r--r-- | src/tangara/audio/track_queue.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<std::shared_mutex> lock(mutex_); - was_queue_empty = playlist_.currentPosition() >= playlist_.size(); + was_queue_empty = currentPosition() >= totalSize(); current_changed = was_queue_empty; // Dont support inserts yet } |
