pcm/Volume: add variable "dest_size"
This commit is contained in:
parent
5fa7610264
commit
326c6ae615
@ -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
|
|||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { data, src.size };
|
return { data, dest_size };
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user