mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
audioconvert2: in merge mode, always process quant samples
This commit is contained in:
parent
c4d77d421a
commit
d5e333eea7
1 changed files with 15 additions and 11 deletions
|
|
@ -2168,16 +2168,6 @@ static int impl_node_process(void *object)
|
||||||
}
|
}
|
||||||
|
|
||||||
resample_passthrough = resample_is_passthrough(this);
|
resample_passthrough = resample_is_passthrough(this);
|
||||||
if (!in_avail || this->drained) {
|
|
||||||
spa_log_debug(this->log, "%p: no input drained:%d", this, this->drained);
|
|
||||||
/* no input, ask for more */
|
|
||||||
resample_update_rate_match(this, resample_passthrough, quant_samples, 0);
|
|
||||||
res |= this->drained ? SPA_STATUS_DRAINED : SPA_STATUS_NEED_DATA;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
mix_passthrough = SPA_FLAG_IS_SET(this->mix.flags, CHANNELMIX_FLAG_IDENTITY);
|
|
||||||
end_passthrough = mix_passthrough && resample_passthrough && out_passthrough;
|
|
||||||
|
|
||||||
/* calculate in/out sizes */
|
/* calculate in/out sizes */
|
||||||
if (this->direction == SPA_DIRECTION_INPUT) {
|
if (this->direction == SPA_DIRECTION_INPUT) {
|
||||||
|
|
@ -2191,9 +2181,21 @@ static int impl_node_process(void *object)
|
||||||
/* in merge mode we consume one duration of samples and
|
/* in merge mode we consume one duration of samples and
|
||||||
* always output the resulting data */
|
* always output the resulting data */
|
||||||
max_out = SPA_MIN(max_out, this->quantum_limit);
|
max_out = SPA_MIN(max_out, this->quantum_limit);
|
||||||
flush_out = true;
|
n_samples = SPA_MIN(n_samples, quant_samples);
|
||||||
|
in_avail = flush_out = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!in_avail || this->drained) {
|
||||||
|
spa_log_debug(this->log, "%p: no input drained:%d", this, this->drained);
|
||||||
|
/* no input, ask for more */
|
||||||
|
resample_update_rate_match(this, resample_passthrough, quant_samples, 0);
|
||||||
|
res |= this->drained ? SPA_STATUS_DRAINED : SPA_STATUS_NEED_DATA;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
mix_passthrough = SPA_FLAG_IS_SET(this->mix.flags, CHANNELMIX_FLAG_IDENTITY);
|
||||||
|
end_passthrough = mix_passthrough && resample_passthrough && out_passthrough;
|
||||||
|
|
||||||
if (!in_passthrough || end_passthrough) {
|
if (!in_passthrough || end_passthrough) {
|
||||||
if (end_passthrough)
|
if (end_passthrough)
|
||||||
out_datas = (void **)dst_datas;
|
out_datas = (void **)dst_datas;
|
||||||
|
|
@ -2232,6 +2234,8 @@ static int impl_node_process(void *object)
|
||||||
spa_log_trace_fp(this->log, "%p: resample %d->%d %d->%d %d", this,
|
spa_log_trace_fp(this->log, "%p: resample %d->%d %d->%d %d", this,
|
||||||
n_samples, max_out, in_len, out_len, out_passthrough);
|
n_samples, max_out, in_len, out_len, out_passthrough);
|
||||||
n_samples = out_len;
|
n_samples = out_len;
|
||||||
|
} else {
|
||||||
|
n_samples = SPA_MIN(n_samples, max_out);
|
||||||
}
|
}
|
||||||
this->out_offset += n_samples;
|
this->out_offset += n_samples;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue