aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-12-08 02:52:02 +0100
committercbdev <cb@cbcdn.com>2019-12-08 02:52:02 +0100
commitac4aa9935bfb6406c71ea5ed14a68bd41617b701 (patch)
treef2aa863a8a3a8a41591da84d3df1ca904245f4f8 /backends
parent99d31eabf4a3afa4fd54782cc1d7cd92fbdae084 (diff)
parent4ca0acff460c1c02a11cb9f246fb755cd4f4f792 (diff)
downloadmidimonster-ac4aa9935bfb6406c71ea5ed14a68bd41617b701.tar.gz
midimonster-ac4aa9935bfb6406c71ea5ed14a68bd41617b701.tar.bz2
midimonster-ac4aa9935bfb6406c71ea5ed14a68bd41617b701.zip
Merge branch 'master' into rtpmidi
Diffstat (limited to 'backends')
-rw-r--r--backends/artnet.c12
-rw-r--r--backends/sacn.c10
2 files changed, 4 insertions, 18 deletions
diff --git a/backends/artnet.c b/backends/artnet.c
index 57eb7b1..e01f038 100644
--- a/backends/artnet.c
+++ b/backends/artnet.c
@@ -77,16 +77,12 @@ static int artnet_configure(char* option, char* value){
else if(!strcmp(option, "bind")){
mmbackend_parse_hostspec(value, &host, &port);
- if(!port){
- port = ARTNET_PORT;
- }
-
if(!host){
fprintf(stderr, "Not valid ArtNet bind address given\n");
return 1;
}
- if(artnet_listener(host, port)){
+ if(artnet_listener(host, (port ? port : ARTNET_PORT))){
fprintf(stderr, "Failed to bind ArtNet descriptor: %s\n", value);
return 1;
}
@@ -140,16 +136,12 @@ static int artnet_configure_instance(instance* inst, char* option, char* value){
else if(!strcmp(option, "dest") || !strcmp(option, "destination")){
mmbackend_parse_hostspec(value, &host, &port);
- if(!port){
- port = ARTNET_PORT;
- }
-
if(!host){
fprintf(stderr, "Not a valid ArtNet destination for instance %s\n", inst->name);
return 1;
}
- return mmbackend_parse_sockaddr(host, port, &data->dest_addr, &data->dest_len);
+ return mmbackend_parse_sockaddr(host, port ? port : ARTNET_PORT, &data->dest_addr, &data->dest_len);
}
fprintf(stderr, "Unknown ArtNet option %s for instance %s\n", option, inst->name);
diff --git a/backends/sacn.c b/backends/sacn.c
index 2229b8a..edb648d 100644
--- a/backends/sacn.c
+++ b/backends/sacn.c
@@ -111,16 +111,13 @@ static int sacn_configure(char* option, char* value){
}
else if(!strcmp(option, "bind")){
mmbackend_parse_hostspec(value, &host, &port);
- if(!port){
- port = SACN_PORT;
- }
if(!host){
fprintf(stderr, "No valid sACN bind address provided\n");
return 1;
}
- if(sacn_listener(host, port, flags)){
+ if(sacn_listener(host, port ? port : SACN_PORT, flags)){
fprintf(stderr, "Failed to bind sACN descriptor: %s\n", value);
return 1;
}
@@ -155,16 +152,13 @@ static int sacn_configure_instance(instance* inst, char* option, char* value){
}
else if(!strcmp(option, "destination")){
mmbackend_parse_hostspec(value, &host, &port);
- if(!port){
- port = SACN_PORT;
- }
if(!host){
fprintf(stderr, "No valid sACN destination for instance %s\n", inst->name);
return 1;
}
- return mmbackend_parse_sockaddr(host, port, &data->dest_addr, &data->dest_len);
+ return mmbackend_parse_sockaddr(host, port ? port : SACN_PORT, &data->dest_addr, &data->dest_len);
}
else if(!strcmp(option, "from")){
next = value;