audioconvert: set monitor port buffer size correctly

Also use quantum_limit samples on the monitor ports.

Fixes #2677
This commit is contained in:
Wim Taymans 2022-09-08 12:25:28 +02:00
parent 900621ba9e
commit 46c8c9ec03

View file

@ -1724,20 +1724,20 @@ impl_node_port_enum_params(void *object, int seq,
case SPA_PARAM_Buffers: case SPA_PARAM_Buffers:
{ {
uint32_t size; uint32_t size;
struct dir *dir;
if (!port->have_format) if (!port->have_format)
return -EIO; return -EIO;
if (result.index > 0) if (result.index > 0)
return 0; return 0;
dir = &this->dir[direction]; if (PORT_IS_DSP(this, direction, port_id)) {
if (dir->mode == SPA_PARAM_PORT_CONFIG_MODE_dsp) {
/* DSP ports always use the quantum_limit as the buffer /* DSP ports always use the quantum_limit as the buffer
* size. */ * size. */
size = this->quantum_limit; size = this->quantum_limit;
} else { } else {
uint32_t irate, orate; uint32_t irate, orate;
struct dir *dir = &this->dir[direction];
/* Convert ports are scaled so that they can always /* Convert ports are scaled so that they can always
* provide one quantum of data */ * provide one quantum of data */
irate = dir->format.info.raw.rate; irate = dir->format.info.raw.rate;