summaryrefslogtreecommitdiff
path: root/src/audio/readahead_source.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/readahead_source.cpp')
-rw-r--r--src/audio/readahead_source.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/audio/readahead_source.cpp b/src/audio/readahead_source.cpp
index 35c5314f..aae878f8 100644
--- a/src/audio/readahead_source.cpp
+++ b/src/audio/readahead_source.cpp
@@ -47,8 +47,8 @@ auto ReadaheadSource::Read(cpp::span<std::byte> dest) -> ssize_t {
// Fill the destination from our buffer, until either the buffer is drained
// or the destination is full.
while (!dest.empty() && (is_refilling_ || !xStreamBufferIsEmpty(buffer_))) {
- size_t bytes_read = xStreamBufferReceive(buffer_, dest.data(),
- dest.size_bytes(), 1);
+ size_t bytes_read =
+ xStreamBufferReceive(buffer_, dest.data(), dest.size_bytes(), 1);
tell_ += bytes_read;
bytes_written += bytes_read;
dest = dest.subspan(bytes_read);
@@ -102,6 +102,10 @@ auto ReadaheadSource::CurrentPosition() -> int64_t {
return tell_;
}
+auto ReadaheadSource::Size() -> std::optional<int64_t> {
+ return wrapped_->Size();
+}
+
auto ReadaheadSource::SetPreambleFinished() -> void {
readahead_enabled_ = true;
BeginReadahead();