diff options
author | cbdev <cb@cbcdn.com> | 2020-04-19 20:40:42 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2020-04-19 20:40:42 +0200 |
commit | 79b7e7dae5814942c04ca33e94e92b89547ffeb2 (patch) | |
tree | 0b1ca9a30b95d43604c81e7bde78786c33f8c186 /backends/jack.c | |
parent | 7c1a283c9213dd273d04af72e24b08beb83aec12 (diff) | |
parent | 462b409d3d1fa16fcab0c7f8b475bb8d8e8b3e90 (diff) | |
download | midimonster-79b7e7dae5814942c04ca33e94e92b89547ffeb2.tar.gz midimonster-79b7e7dae5814942c04ca33e94e92b89547ffeb2.tar.bz2 midimonster-79b7e7dae5814942c04ca33e94e92b89547ffeb2.zip |
Merge current master to rtpmidirtpmidi
Diffstat (limited to 'backends/jack.c')
-rw-r--r-- | backends/jack.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/backends/jack.c b/backends/jack.c index c862096..d430c60 100644 --- a/backends/jack.c +++ b/backends/jack.c @@ -549,38 +549,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; |