From 46c8c9ec0362dcad87b8985d173828c2f496d5b9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 8 Sep 2022 12:25:28 +0200 Subject: [PATCH] audioconvert: set monitor port buffer size correctly Also use quantum_limit samples on the monitor ports. Fixes #2677 --- spa/plugins/audioconvert/audioconvert.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 50c6a5718..bb6614d13 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -1724,20 +1724,20 @@ impl_node_port_enum_params(void *object, int seq, case SPA_PARAM_Buffers: { uint32_t size; - struct dir *dir; if (!port->have_format) return -EIO; if (result.index > 0) return 0; - dir = &this->dir[direction]; - if (dir->mode == SPA_PARAM_PORT_CONFIG_MODE_dsp) { + if (PORT_IS_DSP(this, direction, port_id)) { /* DSP ports always use the quantum_limit as the buffer * size. */ size = this->quantum_limit; } else { uint32_t irate, orate; + struct dir *dir = &this->dir[direction]; + /* Convert ports are scaled so that they can always * provide one quantum of data */ irate = dir->format.info.raw.rate;