aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/jack.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-04-19 20:40:42 +0200
committercbdev <cb@cbcdn.com>2020-04-19 20:40:42 +0200
commit79b7e7dae5814942c04ca33e94e92b89547ffeb2 (patch)
tree0b1ca9a30b95d43604c81e7bde78786c33f8c186 /backends/jack.c
parent7c1a283c9213dd273d04af72e24b08beb83aec12 (diff)
parent462b409d3d1fa16fcab0c7f8b475bb8d8e8b3e90 (diff)
downloadmidimonster-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.c52
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;