mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
resample: fix passthrough check
Only in passthrough we need to just copy input to output. Otherwise we need to ask the resampler for the conversion size.
This commit is contained in:
parent
511bafb436
commit
e095105e57
1 changed files with 3 additions and 3 deletions
|
|
@ -895,6 +895,9 @@ static int impl_node_process(void *object)
|
||||||
uint32_t match_size;
|
uint32_t match_size;
|
||||||
|
|
||||||
if (passthrough) {
|
if (passthrough) {
|
||||||
|
this->io_rate_match->delay = 0;
|
||||||
|
match_size = max - outport->offset / sizeof(float);
|
||||||
|
} else {
|
||||||
if (SPA_FLAG_IS_SET(this->io_rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE))
|
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);
|
resample_update_rate(&this->resample, this->io_rate_match->rate);
|
||||||
else
|
else
|
||||||
|
|
@ -903,9 +906,6 @@ static int impl_node_process(void *object)
|
||||||
this->io_rate_match->delay = resample_delay(&this->resample);
|
this->io_rate_match->delay = resample_delay(&this->resample);
|
||||||
|
|
||||||
match_size = resample_in_len(&this->resample, max - outport->offset / sizeof(float));
|
match_size = resample_in_len(&this->resample, max - outport->offset / sizeof(float));
|
||||||
} else {
|
|
||||||
this->io_rate_match->delay = 0;
|
|
||||||
match_size = max - outport->offset / sizeof(float);
|
|
||||||
}
|
}
|
||||||
match_size -= SPA_MIN(match_size, size - inport->offset / sizeof(float));
|
match_size -= SPA_MIN(match_size, size - inport->offset / sizeof(float));
|
||||||
this->io_rate_match->size = match_size;
|
this->io_rate_match->size = match_size;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue