summaryrefslogtreecommitdiff
path: root/pipewire-jack
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-02-18 18:03:30 +0100
committerWim Taymans <wtaymans@redhat.com>2020-02-18 18:03:30 +0100
commitb3d94cde87abdb61d9a447295e1ed7f769af8635 (patch)
treec80d49e4e869deeca5169fbe0eca27cd06e91f23 /pipewire-jack
parent1f3cb3d207ee29c5015b69d63319d8a861a4e7b3 (diff)
jack: fix stride of midi
Midi has a stride of 1 Error when the number of buffers is too big
Diffstat (limited to 'pipewire-jack')
-rw-r--r--pipewire-jack/src/pipewire-jack.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c
index d29c6917..8b1dba86 100644
--- a/pipewire-jack/src/pipewire-jack.c
+++ b/pipewire-jack/src/pipewire-jack.c
@@ -1375,7 +1375,7 @@ static int param_buffers(struct client *c, struct port *p,
sizeof(float),
MAX_BUFFER_FRAMES * sizeof(float),
sizeof(float)),
- SPA_PARAM_BUFFERS_stride, SPA_POD_Int(4),
+ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(p->object->port.type_id == 0 ? sizeof(float) : 1),
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
break;
case 2:
@@ -1531,8 +1531,10 @@ static int client_node_port_use_buffers(void *object,
pw_log_debug(NAME" %p: port %p %d %d.%d use_buffers %d", c, p, direction,
port_id, mix_id, n_buffers);
- if (n_buffers > MAX_BUFFERS)
+ if (n_buffers > MAX_BUFFERS) {
+ pw_log_error(NAME" %p: too many buffers %u > %u", c, n_buffers, MAX_BUFFERS);
return -EINVAL;
+ }
if (p->object->port.type_id == 2 && direction == SPA_DIRECTION_INPUT) {
fl = PW_MEMMAP_FLAG_READ;