test-mixer: animate volume controls

Fix volume in audiomixer.
This commit is contained in:
Wim Taymans 2017-11-23 18:04:39 +01:00
parent cb3198c458
commit 7f4363d367
3 changed files with 52 additions and 18 deletions

View file

@ -823,19 +823,19 @@ add_port_data(struct impl *this, void *out, size_t outsize, struct port *port, i
}
}
else if (volume < 0.999 || volume > 1.001) {
mix_func_t mix = layer == 0 ? this->copy : this->add;
mix(out, SPA_MEMBER(data, offset, void), len1);
if (len2 > 0)
mix(out + len1, data, len2);
}
else {
mix_scale_func_t mix = layer == 0 ? this->copy_scale : this->add_scale;
mix(out, SPA_MEMBER(data, offset, void), volume, len1);
if (len2 > 0)
mix(out + len1, data, volume, len2);
}
else {
mix_func_t mix = layer == 0 ? this->copy : this->add;
mix(out, SPA_MEMBER(data, offset, void), len1);
if (len2 > 0)
mix(out + len1, data, len2);
}
port->queued_bytes -= outsize;