mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
resample: first resample the data, then apply the new rate
Else we might not have enough input samples for the new rate.
This commit is contained in:
parent
4440ede41c
commit
7e9ab8b457
1 changed files with 5 additions and 8 deletions
|
|
@ -817,14 +817,6 @@ static int impl_node_process(void *object)
|
|||
flush_in = draining = true;
|
||||
}
|
||||
|
||||
if (this->io_rate_match) {
|
||||
if (SPA_FLAG_IS_SET(this->io_rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE)) {
|
||||
resample_update_rate(&this->resample, this->io_rate_match->rate);
|
||||
} else {
|
||||
resample_update_rate(&this->resample, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
in_len = (size - inport->offset) / sizeof(float);
|
||||
out_len = (maxsize - outport->offset) / sizeof(float);
|
||||
|
||||
|
|
@ -881,6 +873,11 @@ static int impl_node_process(void *object)
|
|||
}
|
||||
|
||||
if (this->io_rate_match) {
|
||||
if (SPA_FLAG_IS_SET(this->io_rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE)) {
|
||||
resample_update_rate(&this->resample, this->io_rate_match->rate);
|
||||
} else {
|
||||
resample_update_rate(&this->resample, 1.0);
|
||||
}
|
||||
this->io_rate_match->delay = resample_delay(&this->resample);
|
||||
this->io_rate_match->size = resample_in_len(&this->resample, max);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue