From 326c6ae615fca967fdfb5655fbea5c782b138482 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Jul 2019 21:01:09 +0200 Subject: [PATCH] pcm/Volume: add variable "dest_size" --- src/pcm/Volume.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pcm/Volume.cxx b/src/pcm/Volume.cxx index 563b95db4..2c975af67 100644 --- a/src/pcm/Volume.cxx +++ b/src/pcm/Volume.cxx @@ -127,12 +127,13 @@ PcmVolume::Apply(ConstBuffer 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 src) noexcept return src; } - return { data, src.size }; + return { data, dest_size }; }