diff --git a/src/MusicChunk.hxx b/src/MusicChunk.hxx index 1f8692667..e2cca6035 100644 --- a/src/MusicChunk.hxx +++ b/src/MusicChunk.hxx @@ -127,6 +127,10 @@ struct MusicChunk : MusicChunkInfo { * @return true if the chunk is full */ bool Expand(AudioFormat af, size_t length) noexcept; + + std::span ReadData() const noexcept { + return {data, length}; + } }; static_assert(sizeof(MusicChunk) == CHUNK_SIZE, "Wrong size"); diff --git a/src/output/Source.cxx b/src/output/Source.cxx index d4b7cee1c..9f48e9401 100644 --- a/src/output/Source.cxx +++ b/src/output/Source.cxx @@ -122,7 +122,7 @@ AudioOutputSource::GetChunkData(const MusicChunk &chunk, assert(!chunk.IsEmpty()); assert(chunk.CheckFormat(in_audio_format)); - std::span data(chunk.data, chunk.length); + auto data = chunk.ReadData(); assert(data.size() % in_audio_format.GetFrameSize() == 0);