summaryrefslogtreecommitdiff
path: root/src/audio/include/readahead_source.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-11-20 11:04:20 +1100
committerjacqueline <me@jacqueline.id.au>2023-11-20 11:04:20 +1100
commitb3b512f10e0570f7dc8a04e1613f1234e5532728 (patch)
treed8861607af715c09321165b76d57a4c58e232088 /src/audio/include/readahead_source.hpp
parentd36f314a57b5136f6a7dabfa6cb78a16f1994f4f (diff)
downloadtangara-fw-b3b512f10e0570f7dc8a04e1613f1234e5532728.tar.gz
Don't start readahead until parsing the stream's header is finished
...but also disable readahead for now anyway, since it's unstable
Diffstat (limited to 'src/audio/include/readahead_source.hpp')
-rw-r--r--src/audio/include/readahead_source.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/audio/include/readahead_source.hpp b/src/audio/include/readahead_source.hpp
index dea3ff3f..bbc0da12 100644
--- a/src/audio/include/readahead_source.hpp
+++ b/src/audio/include/readahead_source.hpp
@@ -38,13 +38,18 @@ class ReadaheadSource : public codecs::IStream {
auto CurrentPosition() -> int64_t override;
+ auto SetPreambleFinished() -> void override;
+
ReadaheadSource(const ReadaheadSource&) = delete;
ReadaheadSource& operator=(const ReadaheadSource&) = delete;
private:
+ auto BeginReadahead() -> void;
+
tasks::Worker& worker_;
std::unique_ptr<codecs::IStream> wrapped_;
+ bool readahead_enabled_;
std::atomic<bool> is_refilling_;
StreamBufferHandle_t buffer_;
int64_t tell_;