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