pipewire-jack: return empty buffer when unnegotiated

This commit is contained in:
Wim Taymans 2018-02-16 17:10:25 +01:00
parent 570d32de2b
commit b15da50c13

View file

@ -1725,17 +1725,18 @@ void * jack_port_get_buffer (jack_port_t *port, jack_nframes_t frames)
return NULL; return NULL;
} }
p = GET_PORT(c, GET_DIRECTION(o->port.flags), o->port.port_id); p = GET_PORT(c, GET_DIRECTION(o->port.flags), o->port.port_id);
if (p->n_buffers == 0)
return c->empty;
if (p->direction == SPA_DIRECTION_INPUT) { if (p->direction == SPA_DIRECTION_INPUT) {
io = &c->trans->inputs[p->id]; io = &c->trans->inputs[p->id];
if (io->status != SPA_STATUS_HAVE_BUFFER) if (io->status != SPA_STATUS_HAVE_BUFFER)
return NULL; return c->empty;
b = &p->buffers[io->buffer_id]; b = &p->buffers[io->buffer_id];
io->status = SPA_STATUS_NEED_BUFFER; io->status = SPA_STATUS_NEED_BUFFER;
} else { } else {
b = dequeue_buffer(p); if ((b = dequeue_buffer(p)) == NULL) {
if (b == NULL) {
pw_log_warn("port %p: out of buffers", p); pw_log_warn("port %p: out of buffers", p);
return c->empty; return c->empty;
} }