summaryrefslogtreecommitdiff
path: root/src/modules/compose
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-04-22 14:57:57 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-04-22 14:57:57 -0700
commit549fa449749803818a715f887d8e12ceeb985989 (patch)
treeb7bae2078faf31b581ec10aca0e729871b06beb8 /src/modules/compose
parent4e0138c315d2a165335724f7993724da4f7a1147 (diff)
modules/compose: randomize layer settings
Randomize the setting of the layered modules like rtv does. This needs to free the setup, similarly to the others, once that facility is added.
Diffstat (limited to 'src/modules/compose')
-rw-r--r--src/modules/compose/compose.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c
index 5b46080..180df44 100644
--- a/src/modules/compose/compose.c
+++ b/src/modules/compose/compose.c
@@ -78,12 +78,16 @@ static void * compose_create_context(unsigned ticks, unsigned num_cpus, void *se
ctxt->n_cpus = num_cpus;
for (int i = 0; i < n; i++) {
- const til_module_t *module;
+ const til_module_t *layer_module;
+ void *layer_setup = NULL;
- module = til_lookup_module(((compose_setup_t *)setup)->layers[i]);
+ layer_module = til_lookup_module(((compose_setup_t *)setup)->layers[i]);
+ (void) til_module_randomize_setup(layer_module, &layer_setup, NULL);
- ctxt->layers[i].module = module;
- (void) til_module_create_context(module, ticks, NULL, &ctxt->layers[i].module_ctxt);
+ ctxt->layers[i].module = layer_module;
+ (void) til_module_create_context(layer_module, ticks, layer_setup, &ctxt->layers[i].module_ctxt);
+
+ /* TODO FIXME: free setup! */
ctxt->n_layers++;
}
© All Rights Reserved