Remove some hardcoded channel number values

Mostly related to the number of channels.
This commit is contained in:
Wim Taymans 2025-04-04 15:04:09 +02:00
parent 5cfd461ba2
commit 722776cf65
5 changed files with 8 additions and 6 deletions

View file

@ -320,7 +320,7 @@ static void rtp_opus_process_capture(void *data)
static int rtp_opus_init(struct impl *impl, enum spa_direction direction)
{
int err;
unsigned char mapping[64];
unsigned char mapping[SPA_AUDIO_MAX_CHANNELS];
uint32_t i;
if (impl->psamples >= 2880)

View file

@ -28,7 +28,8 @@
PW_LOG_TOPIC_EXTERN(log_stream);
#define PW_LOG_TOPIC_DEFAULT log_stream
#define MAX_BUFFERS 64
#define MAX_BUFFERS 64u
#define MAX_VALUES 256u
#define MASK_BUFFERS (MAX_BUFFERS-1)
@ -72,7 +73,7 @@ struct control {
struct pw_stream_control control;
struct spa_pod *info;
unsigned int emitted:1;
float values[64];
float values[MAX_VALUES];
};
struct stream {
@ -1354,6 +1355,7 @@ static int node_event_param(void *object, int seq,
if ((values = spa_pod_get_array(&prop->value, &n_values)) == NULL ||
!spa_pod_is_float(SPA_POD_ARRAY_CHILD(&prop->value)))
continue;
n_values = SPA_MIN(n_values, MAX_VALUES);
break;
default:
continue;