aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--backends/artnet.c23
-rw-r--r--backends/artnet.h1
2 files changed, 16 insertions, 8 deletions
diff --git a/backends/artnet.c b/backends/artnet.c
index 4a7907d..dae9ba3 100644
--- a/backends/artnet.c
+++ b/backends/artnet.c
@@ -168,6 +168,10 @@ static int artnet_configure_instance(instance* inst, char* option, char* value){
return mmbackend_parse_sockaddr(host, port ? port : ARTNET_PORT, &data->dest_addr, &data->dest_len);
}
+ else if(!strcmp(option, "realtime")){
+ data->realtime = strtoul(value, NULL, 10);
+ return 0;
+ }
LOGPF("Unknown instance option %s for instance %s", option, inst->name);
return 1;
@@ -294,21 +298,24 @@ static int artnet_set(instance* inst, size_t num, channel** c, channel_value* v)
}
if(mark){
- //find last frame time
+ //find output control data for the instance
for(u = 0; u < global_cfg.fd[data->fd_index].output_instances; u++){
if(global_cfg.fd[data->fd_index].output_instance[u].label == inst->ident){
break;
}
}
- frame_delta = mm_timestamp() - global_cfg.fd[data->fd_index].output_instance[u].last_frame;
- //check output rate limit, request next frame
- if(frame_delta < ARTNET_FRAME_TIMEOUT){
- global_cfg.fd[data->fd_index].output_instance[u].mark = 1;
- if(!global_cfg.next_frame || global_cfg.next_frame > (ARTNET_FRAME_TIMEOUT - frame_delta)){
- global_cfg.next_frame = (ARTNET_FRAME_TIMEOUT - frame_delta);
+ if(!data->realtime){
+ frame_delta = mm_timestamp() - global_cfg.fd[data->fd_index].output_instance[u].last_frame;
+
+ //check output rate limit, request next frame
+ if(frame_delta < ARTNET_FRAME_TIMEOUT){
+ global_cfg.fd[data->fd_index].output_instance[u].mark = 1;
+ if(!global_cfg.next_frame || global_cfg.next_frame > (ARTNET_FRAME_TIMEOUT - frame_delta)){
+ global_cfg.next_frame = (ARTNET_FRAME_TIMEOUT - frame_delta);
+ }
+ return 0;
}
- return 0;
}
return artnet_transmit(inst, global_cfg.fd[data->fd_index].output_instance + u);
}
diff --git a/backends/artnet.h b/backends/artnet.h
index ecd775e..b42646d 100644
--- a/backends/artnet.h
+++ b/backends/artnet.h
@@ -48,6 +48,7 @@ typedef struct /*_artnet_instance_model*/ {
artnet_universe data;
size_t fd_index;
uint64_t last_input;
+ uint8_t realtime;
} artnet_instance_data;
typedef union /*_artnet_instance_id*/ {