From 1f903accd95361735c841c87fdc6494ad3331b40 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 7 Jun 2023 13:19:45 +1000 Subject: Flesh out audio state machine for playback Also fix mono playback --- src/audio/stream_info.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/audio/stream_info.cpp') diff --git a/src/audio/stream_info.cpp b/src/audio/stream_info.cpp index ee85f35d..8fc31530 100644 --- a/src/audio/stream_info.cpp +++ b/src/audio/stream_info.cpp @@ -22,7 +22,8 @@ namespace audio { void InputStream::consume(std::size_t bytes) const { assert(raw_->info->bytes_in_stream >= bytes); - auto new_data = raw_->data.subspan(bytes); + auto new_data = + raw_->data.subspan(bytes, raw_->info->bytes_in_stream - bytes); std::move(new_data.begin(), new_data.end(), raw_->data.begin()); raw_->info->bytes_in_stream = new_data.size_bytes(); } -- cgit v1.2.3