mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-24 22:50:03 +01:00
spa-resample: clamp float values
sndfile does not seem to correctly clip samples so we have to do it ourselves.
This commit is contained in:
parent
e1392cec0e
commit
8e6945c496
1 changed files with 1 additions and 1 deletions
|
|
@ -297,7 +297,7 @@ static int do_conversion(struct data *d)
|
|||
if (pout_len > 0) {
|
||||
for (k = 0, i = 0; i < pout_len; i++) {
|
||||
for (j = 0; j < channels; j++) {
|
||||
obuf[k++] = out[MAX_SAMPLES * j + i];
|
||||
obuf[k++] = SPA_CLAMP(out[MAX_SAMPLES * j + i], -1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
pout_len = sf_writef_float(d->ofile, obuf, pout_len);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue