pcm/Volume: use 0x69 to generate DSD silence

This commit is contained in:
Max Kellermann 2016-07-01 21:22:21 +02:00
parent 072e39c9cf
commit ba8e579e9b

View File

@ -134,9 +134,11 @@ PcmVolume::Apply(ConstBuffer<void> src)
if (volume == 0) {
/* optimized special case: 0% volume = memset(0) */
/* TODO: is this valid for all sample formats? What
about floating point? */
memset(data, 0, src.size);
uint8_t pattern = 0;
if (format == SampleFormat::DSD)
pattern = 0x69;
memset(data, pattern, src.size);
return { data, src.size };
}