From 31cc72f660513b033cc0621782586562bafab08e Mon Sep 17 00:00:00 2001 From: cbdev Date: Tue, 10 Dec 2019 22:35:59 +0100 Subject: Fix bug in sACN config parsing --- backends/sacn.c | 1 + 1 file changed, 1 insertion(+) (limited to 'backends/sacn.c') diff --git a/backends/sacn.c b/backends/sacn.c index edb648d..75c327e 100644 --- a/backends/sacn.c +++ b/backends/sacn.c @@ -171,6 +171,7 @@ static int sacn_configure_instance(instance* inst, char* option, char* value){ } else if(!strcmp(option, "unicast")){ data->unicast_input = strtoul(value, NULL, 10); + return 0; } fprintf(stderr, "Unknown configuration option %s for sACN backend\n", option); -- cgit v1.2.3 From f65fb8baaba285f5ff4b02af111420ba4479f5d9 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 11 Dec 2019 23:02:22 +0100 Subject: Simplify plugin_start API --- backends/sacn.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'backends/sacn.c') diff --git a/backends/sacn.c b/backends/sacn.c index 75c327e..877cbb0 100644 --- a/backends/sacn.c +++ b/backends/sacn.c @@ -531,10 +531,9 @@ static int sacn_handle(size_t num, managed_fd* fds){ return 0; } -static int sacn_start(){ - size_t n, u, p; +static int sacn_start(size_t n, instance** inst){ + size_t u, p; int rv = 1; - instance** inst = NULL; sacn_instance_data* data = NULL; sacn_instance_id id = { .label = 0 @@ -544,17 +543,6 @@ static int sacn_start(){ }; struct sockaddr_in* dest_v4 = NULL; - //fetch all instances - if(mm_backend_instances(BACKEND_NAME, &n, &inst)){ - fprintf(stderr, "Failed to fetch instance list\n"); - return 1; - } - - if(!n){ - free(inst); - return 0; - } - if(!global_cfg.fds){ fprintf(stderr, "Failed to start sACN backend: no descriptors bound\n"); free(inst); @@ -625,7 +613,6 @@ static int sacn_start(){ rv = 0; bail: - free(inst); return rv; } -- cgit v1.2.3 From f6d6eefe9bb9934f4fa3e665734d746f02471cdb Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 11 Dec 2019 23:20:34 +0100 Subject: Simplify plugin_stop API --- backends/sacn.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'backends/sacn.c') diff --git a/backends/sacn.c b/backends/sacn.c index 877cbb0..ef422e8 100644 --- a/backends/sacn.c +++ b/backends/sacn.c @@ -616,19 +616,12 @@ bail: return rv; } -static int sacn_shutdown(){ - size_t n, p; - instance** inst = NULL; - - if(mm_backend_instances(BACKEND_NAME, &n, &inst)){ - fprintf(stderr, "Failed to fetch instance list\n"); - return 1; - } +static int sacn_shutdown(size_t n, instance** inst){ + size_t p; for(p = 0; p < n; p++){ free(inst[p]->impl); } - free(inst); for(p = 0; p < global_cfg.fds; p++){ close(global_cfg.fd[p].fd); -- cgit v1.2.3