add some constants for max samples

This commit is contained in:
Wim Taymans 2019-10-24 12:35:00 +02:00
parent 605a0a6f97
commit 2fa97daa24
8 changed files with 31 additions and 22 deletions

View file

@ -47,7 +47,9 @@
#define DEFAULT_RATE 48000
#define DEFAULT_CHANNELS 2
#define MAX_SAMPLES 1024
#define MAX_BUFFERS 64
#define MAX_ALIGN 16
#define MAX_DATAS 32
#define MAX_PORTS 128
@ -473,9 +475,9 @@ impl_node_port_enum_params(void *object, int seq,
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(port->blocks),
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(
2048 * port->stride,
MAX_SAMPLES * 2 * port->stride,
16 * port->stride,
INT32_MAX / port->stride),
INT32_MAX),
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(port->stride),
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
}
@ -698,7 +700,7 @@ impl_node_port_use_buffers(void *object,
this, j, i);
return -EINVAL;
}
if (!SPA_IS_ALIGNED(d[j].data, 16)) {
if (!SPA_IS_ALIGNED(d[j].data, MAX_ALIGN)) {
spa_log_warn(this->log, NAME " %p: memory %d on buffer %d not aligned",
this, j, i);
}