mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
resample-peaks: improve peaks some more
Update the i_count in the loop because we use it to check when we have completed a chunk.
This commit is contained in:
parent
48bf039e25
commit
b5b01f4dd2
1 changed files with 2 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ static void resample_peaks_process(struct resample *r,
|
|||
m = peaks_abs_max(&pd->peaks, &s[i], chunk, m);
|
||||
|
||||
i += chunk;
|
||||
i_count += chunk;
|
||||
|
||||
if (chunk == end) {
|
||||
d[o++] = m;
|
||||
|
|
@ -56,7 +57,7 @@ static void resample_peaks_process(struct resample *r,
|
|||
*out_len = o;
|
||||
*in_len = i;
|
||||
pd->o_count = o_count;
|
||||
pd->i_count = i_count + i;
|
||||
pd->i_count = i_count;
|
||||
|
||||
while (pd->i_count >= r->i_rate && pd->o_count >= r->o_rate) {
|
||||
pd->i_count -= r->i_rate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue