summaryrefslogtreecommitdiff
path: root/src/tangara/audio/stream_cues.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tangara/audio/stream_cues.cpp')
-rw-r--r--src/tangara/audio/stream_cues.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tangara/audio/stream_cues.cpp b/src/tangara/audio/stream_cues.cpp
index 7a6a1426..6a9a7674 100644
--- a/src/tangara/audio/stream_cues.cpp
+++ b/src/tangara/audio/stream_cues.cpp
@@ -24,6 +24,7 @@ auto StreamCues::update(uint32_t sample) -> void {
}
now_ = sample;
+ // Advance the current queue until we've caught up.
while (!upcoming_.empty() && upcoming_.front().start_at <= now_) {
current_ = upcoming_.front();
upcoming_.pop_front();
@@ -59,7 +60,8 @@ auto StreamCues::current() -> std::pair<std::shared_ptr<TrackInfo>, uint32_t> {
}
auto StreamCues::hasStream() -> bool {
- return current_ || !upcoming_.empty();
+ // 'current_' might be tracking how long we've been playing nothing for.
+ return (current_ && current_->track) || !upcoming_.empty();
}
} // namespace audio