mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
resample-native: substract num of skipped samples after processing input
Takes into account the number of skipped samples when deciding whether we should copy the remaining samples in the history or not. Fixes dropping audio issue when resampling from high frequencies such as 48KHz to low requencies such as 8KHz.
This commit is contained in:
parent
7bd7476426
commit
03bc36a502
1 changed files with 2 additions and 2 deletions
|
|
@ -258,13 +258,13 @@ static void impl_native_process(struct resample *r,
|
|||
int skip = in - hist;
|
||||
/* we are past the history and can now work on the new
|
||||
* input data */
|
||||
in = *in_len - skip;
|
||||
in = *in_len;
|
||||
data->func(r, src, skip, &in, dst, out, out_len);
|
||||
|
||||
spa_log_trace_fp(r->log, "native %p: in:%d/%d out %d/%d",
|
||||
r, *in_len, in, *out_len, out);
|
||||
|
||||
remain = *in_len - in;
|
||||
remain = *in_len - skip - in;
|
||||
if (remain > 0 && remain < n_taps) {
|
||||
/* not enough input data remaining for more output,
|
||||
* copy to history */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue