aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/ola.cpp
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
committercbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
commit37e712edf23a49be5387f945ab9ea57cc0b57f22 (patch)
tree5037b14bdbd08baa8f104f7e4946aa5643281a94 /backends/ola.cpp
parent666aec036f9bf0de82c435bd7eace271613cee1e (diff)
parentaa02ccf3abf183207b24fcbb9460cbd904a698e2 (diff)
downloadmidimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.gz
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.bz2
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.zip
Merge current master
Diffstat (limited to 'backends/ola.cpp')
-rw-r--r--backends/ola.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/backends/ola.cpp b/backends/ola.cpp
index 09d68c9..106dbd5 100644
--- a/backends/ola.cpp
+++ b/backends/ola.cpp
@@ -40,21 +40,15 @@ static int ola_configure(char* option, char* value){
return 1;
}
-static instance* ola_instance(){
- ola_instance_data* data = NULL;
- instance* inst = mm_instance();
- if(!inst){
- return NULL;
- }
-
- data = (ola_instance_data*)calloc(1, sizeof(ola_instance_data));
+static int ola_instance(instance* inst){
+ ola_instance_data* data = (ola_instance_data*) calloc(1, sizeof(ola_instance_data));
if(!data){
LOG("Failed to allocate memory");
- return NULL;
+ return 1;
}
inst->impl = data;
- return inst;
+ return 0;
}
static int ola_configure_instance(instance* inst, char* option, char* value){
@@ -188,7 +182,7 @@ static void ola_data_receive(unsigned int universe, const ola::DmxBuffer& ola_dm
else{
chan = mm_channel(inst, p, 0);
}
-
+
if(!chan){
LOGPF("Active channel %" PRIsize_t " on %s not known to core", p, inst->name);
return;