From acccd822f0147147dd8b16f059578df073c088c2 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 19 Jun 2023 15:36:43 +1000 Subject: back to back flac playback is working :) --- src/audio/include/stream_info.hpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/audio/include/stream_info.hpp') diff --git a/src/audio/include/stream_info.hpp b/src/audio/include/stream_info.hpp index 54b87003..4db3e5fd 100644 --- a/src/audio/include/stream_info.hpp +++ b/src/audio/include/stream_info.hpp @@ -26,10 +26,9 @@ struct StreamInfo { // stream's buffer. std::size_t bytes_in_stream{0}; - // The total length of this stream, in case its source is finite (e.g. a - // file on disk). May be absent for endless streams (internet streams, - // generated audio, etc.) - std::optional length_bytes{}; + bool is_producer_finished = true; + + bool is_consumer_finished = true; // std::optional seek_to_seconds{}; @@ -62,10 +61,8 @@ class RawStream { public: StreamInfo* info; cpp::span data; - bool is_incomplete; - RawStream(StreamInfo* i, cpp::span d) - : info(i), data(d), is_incomplete(false) {} + RawStream(StreamInfo* i, cpp::span d) : info(i), data(d) {} }; /* @@ -78,7 +75,9 @@ class InputStream { void consume(std::size_t bytes) const; - void mark_incomplete() const; + bool is_producer_finished() const; + + void mark_consumer_finished() const; const StreamInfo& info() const; @@ -100,7 +99,9 @@ class OutputStream { cpp::span data() const; - bool is_incomplete() const; + bool is_consumer_finished() const; + + void mark_producer_finished() const; private: RawStream* raw_; -- cgit v1.2.3