summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-27 14:28:05 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-27 14:34:06 -0700
commit1ca8c79f3f003314967e58b90eadbcee27f7e785 (patch)
treeab911f6d53b9d0d28894daac12ae46f6e6e8a059
parentd412e89e8b61162fcf762cd23df3fcf609857a66 (diff)
modules/rtv: don't use n_cpus=0 for the context creates
This is harmless as long as rtv stays hermetic. But if rtv gets used in a composite scenario in the future by either removing the hermetic flag, or allowing forced overrides, n_cpus=0 will cause the nested module contexts to become threaded on SMP machines. That's problematic if the outer module context is already a threaded render. What's appropriate here is to just propagate the n_cpus down so if an upper layer has already gone threaded, it will be sending down n_cpus=1 to serialize the nested instances. In practice, as-is, this change basically changes nothing, but prepares for a potential future where rtv participates in threaded compositions. Through a lens of "rtv just rejiggers scenes and there settings on a timer from a settings-specified subset of modules and settings" it's arguably useful as just another module. Sometimes you want something to change itself up periodically in say a compose layer. So preparing for this possibility isn't really all that far-fetched/hypothetical.
-rw-r--r--src/modules/rtv/rtv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 8648ea3..6255a60 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -195,7 +195,7 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks)
}
if (!ctxt->channel->module_ctxt)
- (void) til_module_create_context(ctxt->channel->module, ctxt->til_module_context.stream, rand_r(&ctxt->til_module_context.seed), ticks, 0, ctxt->til_module_context.path, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
+ (void) til_module_create_context(ctxt->channel->module, ctxt->til_module_context.stream, rand_r(&ctxt->til_module_context.seed), ticks, ctxt->til_module_context.n_cpus, ctxt->til_module_context.path, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
ctxt->channel->last_on_time = now;
}
@@ -257,7 +257,7 @@ static til_module_context_t * rtv_create_context(const til_module_t *module, til
((rtv_setup_t *)setup)->snow_module_setup = NULL;
ctxt->snow_channel.module = til_lookup_module(((rtv_setup_t *)setup)->snow_module_name);
- (void) til_module_create_context(ctxt->snow_channel.module, stream, rand_r(&seed), ticks, 0, path, ctxt->snow_channel.module_setup, &ctxt->snow_channel.module_ctxt);
+ (void) til_module_create_context(ctxt->snow_channel.module, stream, rand_r(&seed), ticks, n_cpus, path, ctxt->snow_channel.module_setup, &ctxt->snow_channel.module_ctxt);
}
ctxt->log_channels = ((rtv_setup_t *)setup)->log_channels;
© All Rights Reserved