Revert "Bug 2027433 Treat null input channels as zero in InterleaveAndConvertBuffer()"

This reverts commit e76fc5637a.
This commit is contained in:
Moonchild committed 2026-06-05 11:28:55 +02:00
1 parent be3827b088
commit ad06b4ce5e
1 file changed
+7 -14
+7 -14
View File
@@ -61,22 +61,15 @@ template <typename SrcT, typename DestT>
static void
InterleaveAndConvertBuffer(const SrcT* const* aSourceChannels,
uint32_t aLength, float aVolume,
uint32_t aChannelCount,
uint32_t aChannels,
DestT* aOutput)
{
for (size_t channel = 0; channel < aChannelCount; ++channel) {
DestT* output = aOutput;
if (aSourceChannels[channel]) {
for (size_t i = 0; i < aLength; ++i) {
float v = AudioSampleToFloat(aSourceChannels[channel][i])*aVolume;
*output = FloatToAudioSample<DestT>(v);
output += aChannelCount;
}
} else {
for (size_t i = 0; i < aLength; ++i) {
*output = static_cast<DestT>(0);
output += aChannelCount;
}
DestT* output = aOutput;
for (size_t i = 0; i < aLength; ++i) {
for (size_t channel = 0; channel < aChannels; ++channel) {
float v = AudioSampleToFloat(aSourceChannels[channel][i])*aVolume;
*output = FloatToAudioSample<DestT>(v);
++output;
}
}
}