mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
resample: fix off-by-one in out_len calculation
Fix off-by-one and add test.
This commit is contained in:
parent
91ebfac75b
commit
84e8d59782
2 changed files with 82 additions and 9 deletions
|
|
@ -190,7 +190,7 @@ static uint32_t impl_native_out_len(struct resample *r, uint32_t in_len)
|
|||
struct native_data *data = r->data;
|
||||
uint32_t out_len;
|
||||
|
||||
in_len = in_len - SPA_MIN(in_len, (data->n_taps - data->hist) + 1);
|
||||
in_len = in_len - SPA_MIN(in_len, data->n_taps - data->hist);
|
||||
out_len = (uint32_t)(in_len * data->out_rate - data->phase);
|
||||
out_len = (out_len + data->in_rate - 1) / data->in_rate;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue