channelmix: reset the volume if the channels changed.

This commit is contained in:
Wim Taymans 2020-09-29 12:01:39 +02:00
parent f70d0b19af
commit 2df10d1a40

View file

@ -252,7 +252,11 @@ static int setup_convert(struct impl *this,
if ((res = channelmix_init(&this->mix)) < 0)
return res;
this->props.n_channel_volumes = SPA_MAX(src_chan, dst_chan);
if (this->props.n_channel_volumes != this->mix.src_chan) {
this->props.n_channel_volumes = this->mix.src_chan;
for (i = 0; i < SPA_AUDIO_MAX_CHANNELS; i++)
this->props.channel_volumes[i] = 1.0;
}
channelmix_set_volume(&this->mix, this->props.volume, this->props.mute,
this->props.n_channel_volumes, this->props.channel_volumes);