From fc57f05e56f537a8f1fddd7e110eca459919a0cf Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 16 Jun 2020 15:51:15 +0200 Subject: [PATCH] audioconvert: reduce memory usage We only need as many ports and buffer data as the maximum number of channels, which is 64. Fix empty output size. We're only ever going to fill this with float samples. --- spa/plugins/audioconvert/merger.c | 8 ++++---- spa/plugins/audioconvert/splitter.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index decb27c90..96936b6fa 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -53,9 +53,9 @@ #define MAX_SAMPLES 8192 #define MAX_ALIGN 16 -#define MAX_BUFFERS 64 -#define MAX_DATAS 32 -#define MAX_PORTS 128 +#define MAX_BUFFERS 32 +#define MAX_DATAS 64 +#define MAX_PORTS 64 struct buffer { uint32_t id; @@ -116,7 +116,7 @@ struct impl { unsigned int monitor:1; unsigned int have_profile:1; - float empty[MAX_SAMPLES*2 + MAX_ALIGN]; + float empty[MAX_SAMPLES + MAX_ALIGN]; }; #define CHECK_IN_PORT(this,d,p) ((d) == SPA_DIRECTION_INPUT && (p) < this->port_count) diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 6877df8f6..81f48c9bc 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -52,9 +52,9 @@ #define MAX_SAMPLES 8192 #define MAX_ALIGN 16 -#define MAX_BUFFERS 64 -#define MAX_DATAS 32 -#define MAX_PORTS 128 +#define MAX_BUFFERS 32 +#define MAX_DATAS 64 +#define MAX_PORTS 64 struct buffer { uint32_t id; @@ -116,7 +116,7 @@ struct impl { bool have_profile; - float empty[MAX_SAMPLES*2 + MAX_ALIGN]; + float empty[MAX_SAMPLES + MAX_ALIGN]; }; #define CHECK_OUT_PORT(this,d,p) ((d) == SPA_DIRECTION_OUTPUT && (p) < this->port_count)