diff options
author | cbdev <cb@cbcdn.com> | 2017-06-22 14:30:33 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2017-06-22 14:30:33 +0200 |
commit | dda3f958716f7a6ce644d03f753add778d6f1512 (patch) | |
tree | e2772355daf3728307da26f7a441ba1c60e9d4c7 | |
parent | 66c59fd7ec79338a47c68077674350ee2c74f326 (diff) | |
download | midimonster-dda3f958716f7a6ce644d03f753add778d6f1512.tar.gz midimonster-dda3f958716f7a6ce644d03f753add778d6f1512.tar.bz2 midimonster-dda3f958716f7a6ce644d03f753add778d6f1512.zip |
Minor fixes to multiple backends
-rw-r--r-- | artnet.c | 1 | ||||
-rw-r--r-- | loopback.c | 2 | ||||
-rw-r--r-- | midi.c | 10 |
3 files changed, 10 insertions, 3 deletions
@@ -337,6 +337,7 @@ static int artnet_start(){ } if(!n){ + free(inst); return 0; } @@ -29,7 +29,7 @@ static int backend_configure(char* option, char* value){ return 0; } -static int backend_configure_instance(instance* instance, char* option, char* value){ +static int backend_configure_instance(instance* inst, char* option, char* value){ //intentionally ignored return 0; } @@ -273,6 +273,12 @@ static int midi_start(){ return 1; } + //if there are no ports, do nothing + if(!n){ + free(inst); + return 0; + } + //create all ports for(p = 0; p < n; p++){ data = (midi_instance_data*) inst[p]->impl; @@ -281,8 +287,8 @@ static int midi_start(){ //make connections if(data->write){ - fprintf(stderr, "Connecting output of instance %s to MIDI device %s\n", inst[p]->name, data->write); if(snd_seq_parse_address(sequencer, &addr, data->write) == 0){ + fprintf(stderr, "Connecting output of instance %s to MIDI device %s (%d:%d)\n", inst[p]->name, data->write, addr.client, addr.port); snd_seq_connect_to(sequencer, data->port, addr.client, addr.port); } else{ @@ -293,8 +299,8 @@ static int midi_start(){ } if(data->read){ - fprintf(stderr, "Connecting input from MIDI device %s to instance %s\n", data->read, inst[p]->name); if(snd_seq_parse_address(sequencer, &addr, data->read) == 0){ + fprintf(stderr, "Connecting input from MIDI device %s to instance %s (%d:%d)\n", data->read, inst[p]->name, addr.client, addr.port); snd_seq_connect_from(sequencer, data->port, addr.client, addr.port); } else{ |