Commit 326c6ae6 authored by Max Kellermann's avatar Max Kellermann

pcm/Volume: add variable "dest_size"

parent 5fa76102
......@@ -127,12 +127,13 @@ PcmVolume::Apply(ConstBuffer<void> src) noexcept
if (volume == PCM_VOLUME_1)
return src;
void *data = buffer.Get(src.size);
size_t dest_size = src.size;
void *data = buffer.Get(dest_size);
if (volume == 0) {
/* optimized special case: 0% volume = memset(0) */
PcmSilence({data, src.size}, format);
return { data, src.size };
PcmSilence({data, dest_size}, format);
return { data, dest_size };
}
switch (format) {
......@@ -180,5 +181,5 @@ PcmVolume::Apply(ConstBuffer<void> src) noexcept
return src;
}
return { data, src.size };
return { data, dest_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