Commit a06bf388 authored by Max Kellermann's avatar Max Kellermann

MusicChunk: make the struct size exactly 4096

parent de0c3e71
...@@ -124,7 +124,7 @@ struct MusicChunkInfo { ...@@ -124,7 +124,7 @@ struct MusicChunkInfo {
*/ */
struct MusicChunk : MusicChunkInfo { struct MusicChunk : MusicChunkInfo {
/** the data (probably PCM) */ /** the data (probably PCM) */
uint8_t data[CHUNK_SIZE]; uint8_t data[CHUNK_SIZE - sizeof(MusicChunkInfo)];
/** /**
* Prepares appending to the music chunk. Returns a buffer * Prepares appending to the music chunk. Returns a buffer
...@@ -153,4 +153,6 @@ struct MusicChunk : MusicChunkInfo { ...@@ -153,4 +153,6 @@ struct MusicChunk : MusicChunkInfo {
bool Expand(AudioFormat af, size_t length) noexcept; bool Expand(AudioFormat af, size_t length) noexcept;
}; };
static_assert(sizeof(MusicChunk) == CHUNK_SIZE, "Wrong size");
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment