From 1fd20d00ec5ed8f17783c4b64fa66e76ffad14f2 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Thu, 18 Feb 2021 04:04:07 -0800
Subject: modules/rtv: fix "none" snow to actually blank

This manifests in the current unconfigured rtv glimmer shows, since
the default is a the "none" module when no settings are applied.

But it turns out this isn't just a glimmer problem, "none" is advertised
in the settings as a blanking alternative to snow.  So it's actually
broken in rototiller as well.

This fixes it by detecting the nil "none" module's lack of any
prepare_frame or render_fragment methods, and open coding the blanker
with a fb_fragment_zero() inline.
---
 src/modules/rtv/rtv.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/modules')

diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 373da93..7731603 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -279,7 +279,14 @@ static void rtv_prepare_frame(void *context, unsigned ticks, unsigned n_cpus, fb
 	if (now >= ctxt->next_hide_caption)
 		ctxt->caption = NULL;
 
-	rototiller_module_render(ctxt->channel->module, ctxt->channel->module_ctxt, ticks, fragment);
+	/* there's a special-case "none" (or unconfigured) snow module, that just blanks,
+	 * it's a nil module so just implement it here.
+	 */
+	if (!ctxt->channel->module->render_fragment &&
+	    !ctxt->channel->module->prepare_frame)
+		fb_fragment_zero(fragment);
+	else
+		rototiller_module_render(ctxt->channel->module, ctxt->channel->module_ctxt, ticks, fragment);
 }
 
 
-- 
cgit v1.2.3