mixer: increase mixer ports from 128 to 512

Don't allocate the mixer arrays on the stack but include in the
implementation structure.
This commit is contained in:
Wim Taymans 2023-04-21 15:58:38 +02:00
parent b9cf2638b3
commit 8cfa5ccd79
3 changed files with 20 additions and 11 deletions

View file

@ -29,7 +29,7 @@ static struct spa_log_topic *log_topic = &SPA_LOG_TOPIC(0, "spa.audiomixer");
#define DEFAULT_CHANNELS 2
#define MAX_BUFFERS 64
#define MAX_PORTS 128
#define MAX_PORTS 512
#define MAX_CHANNELS 64
#define MAX_ALIGN MIX_OPS_MAX_ALIGN
@ -103,6 +103,9 @@ struct impl {
struct port *in_ports[MAX_PORTS];
struct port out_ports[1];
struct buffer *mix_buffers[MAX_PORTS];
const void *mix_datas[MAX_PORTS];
int n_formats;
struct spa_audio_info format;
@ -737,9 +740,9 @@ static int impl_node_process(void *object)
outio->buffer_id = SPA_ID_INVALID;
}
buffers = alloca(MAX_PORTS * sizeof(struct buffer *));
datas = alloca(MAX_PORTS * sizeof(void *));
n_buffers = 0;
buffers = this->mix_buffers;
datas = this->mix_datas;
n_buffers = 0;
maxsize = UINT32_MAX;

View file

@ -26,7 +26,7 @@
static struct spa_log_topic *log_topic = &SPA_LOG_TOPIC(0, "spa.mixer-dsp");
#define MAX_BUFFERS 64
#define MAX_PORTS 128
#define MAX_PORTS 512
#define MAX_ALIGN MIX_OPS_MAX_ALIGN
#define PORT_DEFAULT_VOLUME 1.0
@ -100,6 +100,9 @@ struct impl {
struct port *in_ports[MAX_PORTS];
struct port out_ports[1];
struct buffer *mix_buffers[MAX_PORTS];
const void *mix_datas[MAX_PORTS];
int n_formats;
struct spa_audio_info format;
uint32_t stride;
@ -673,8 +676,8 @@ static int impl_node_process(void *object)
outio->buffer_id = SPA_ID_INVALID;
}
buffers = alloca(MAX_PORTS * sizeof(struct buffer *));
datas = alloca(MAX_PORTS * sizeof(void *));
buffers = this->mix_buffers;
datas = this->mix_datas;
n_buffers = 0;
maxsize = UINT32_MAX;

View file

@ -23,7 +23,7 @@
#define NAME "control-mixer"
#define MAX_BUFFERS 64
#define MAX_PORTS 128
#define MAX_PORTS 512
struct buffer {
uint32_t id;
@ -70,6 +70,9 @@ struct impl {
struct port *in_ports[MAX_PORTS];
struct port out_ports[1];
struct spa_pod_control *mix_ctrl[MAX_PORTS];
struct spa_pod_sequence *mix_seq[MAX_PORTS];
int n_formats;
unsigned int have_format:1;
@ -624,9 +627,9 @@ static int impl_node_process(void *object)
return -EPIPE;
}
ctrl = alloca(MAX_PORTS * sizeof(struct spa_pod_control *));
seq = alloca(MAX_PORTS * sizeof(struct spa_pod_sequence *));
n_seq = 0;
ctrl = this->mix_ctrl;
seq = this->mix_seq;
n_seq = 0;
/* collect all sequence pod on input ports */
for (i = 0; i < this->last_port; i++) {