Commit 2ca97942 authored by Max Kellermann's avatar Max Kellermann

MusicChunk: copy AudioFormat only when chunk is empty

parent 8d822ebd
...@@ -52,6 +52,10 @@ MusicChunk::Write(const AudioFormat af, ...@@ -52,6 +52,10 @@ MusicChunk::Write(const AudioFormat af,
bit_rate = _bit_rate; bit_rate = _bit_rate;
time = data_time; time = data_time;
#ifndef NDEBUG
audio_format = af;
#endif
} }
const size_t frame_size = af.GetFrameSize(); const size_t frame_size = af.GetFrameSize();
...@@ -59,10 +63,6 @@ MusicChunk::Write(const AudioFormat af, ...@@ -59,10 +63,6 @@ MusicChunk::Write(const AudioFormat af,
if (num_frames == 0) if (num_frames == 0)
return WritableBuffer<void>::Null(); return WritableBuffer<void>::Null();
#ifndef NDEBUG
audio_format = af;
#endif
return { data + length, num_frames * frame_size }; return { data + length, num_frames * frame_size };
} }
......
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