diff options
author | cbdev <cb@cbcdn.com> | 2020-04-27 22:50:47 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2020-04-27 22:50:47 +0200 |
commit | 1d8ed32bf769bc99095cd32ec166e681437607f0 (patch) | |
tree | bc94fd3a0245e91c15659916fc1c3591c7fb44b7 /backends/jack.c | |
parent | d4714dfdd5c6e2d165d1ad9327fdce69a1b2b85b (diff) | |
parent | c0bb55ff08faf2f89af947090d1c9bc412927d9f (diff) | |
download | midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.tar.gz midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.tar.bz2 midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.zip |
Merge branch 'master' into debian/master
Diffstat (limited to 'backends/jack.c')
-rw-r--r-- | backends/jack.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/backends/jack.c b/backends/jack.c index c862096..c84ed0f 100644 --- a/backends/jack.c +++ b/backends/jack.c @@ -205,7 +205,9 @@ static int mmjack_process(jack_nframes_t nframes, void* instp){ //notify the main thread if(mark){ DBGPF("Notifying handler thread for instance %s", inst->name); - send(data->fd, "c", 1, 0); + if(send(data->fd, "c", 1, 0) != 1){ + DBGPF("Failed to notify main thread on %s", inst->name); + } } return rv; } @@ -549,38 +551,36 @@ static int mmjack_handle(size_t num, managed_fd* fds){ ssize_t bytes; uint8_t recv_buf[1024]; - if(num){ - for(u = 0; u < num; u++){ - inst = (instance*) fds[u].impl; - data = (mmjack_instance_data*) inst->impl; - bytes = recv(fds[u].fd, recv_buf, sizeof(recv_buf), 0); - if(bytes < 0){ - LOGPF("Failed to receive on feedback socket for instance %s", inst->name); - return 1; - } + for(u = 0; u < num; u++){ + inst = (instance*) fds[u].impl; + data = (mmjack_instance_data*) inst->impl; + bytes = recv(fds[u].fd, recv_buf, sizeof(recv_buf), 0); + if(bytes < 0){ + LOGPF("Failed to receive on feedback socket for instance %s", inst->name); + return 1; + } - for(p = 0; p < data->ports; p++){ - if(data->port[p].input && data->port[p].mark){ - pthread_mutex_lock(&data->port[p].lock); - switch(data->port[p].type){ - case port_cv: - mmjack_handle_cv(inst, p, data->port + p); - break; - case port_midi: - mmjack_handle_midi(inst, p, data->port + p); - break; - default: - LOGPF("Output handler not implemented for unknown channel type on %s.%s", inst->name, data->port[p].name); - break; - } - - data->port[p].mark = 0; - pthread_mutex_unlock(&data->port[p].lock); + for(p = 0; p < data->ports; p++){ + if(data->port[p].input && data->port[p].mark){ + pthread_mutex_lock(&data->port[p].lock); + switch(data->port[p].type){ + case port_cv: + mmjack_handle_cv(inst, p, data->port + p); + break; + case port_midi: + mmjack_handle_midi(inst, p, data->port + p); + break; + default: + LOGPF("Output handler not implemented for unknown channel type on %s.%s", inst->name, data->port[p].name); + break; } + + data->port[p].mark = 0; + pthread_mutex_unlock(&data->port[p].lock); } } } - + if(config.jack_shutdown){ LOG("Server disconnected"); return 1; |