]> git.sesse.net Git - ultimatescore/commitdiff
Don't show the CasparCG on the static picture.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 22 Apr 2017 10:51:25 +0000 (12:51 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 22 Apr 2017 10:51:25 +0000 (12:51 +0200)
nageru/ultimate.lua

index c4fc522826db3f0fa36b763ae51dd0d24b71dab0..328dfa2048c254444aa5b82ac605a513f6ac64fb 100644 (file)
@@ -122,8 +122,26 @@ function make_fade_chain(input0_live, input0_deint, input0_scale, input1_live, i
        local input0 = make_fade_input(chain, INPUT0_SIGNAL_NUM, input0_live, input0_deint, input0_scale)
        local input1 = make_fade_input(chain, INPUT1_SIGNAL_NUM, input1_live, input1_deint, input1_scale)
 
+       -- If fading between two live inputs, the overlay is put on top.
+       -- If fading between the static picture and a live input,
+       -- the overlay is put on the live input.
+       local overlay = nil
+       if input0_live and not input1_live then
+               overlay = possibly_make_overlay(has_overlay, chain, input0.last)
+               if overlay then
+                       input0.last = overlay.overlay_effect
+               end
+       elseif input1_live and not input0_live then
+               overlay = possibly_make_overlay(has_overlay, chain, input1.last)
+               if overlay then
+                       input1.last = overlay.overlay_effect
+               end
+       end
+
        local mix_effect = chain:add_effect(MixEffect.new(), input0.last, input1.last)
-       local overlay = possibly_make_overlay(has_overlay, chain, mix_effect)
+       if input0_live and input1_live then
+               overlay = possibly_make_overlay(has_overlay, chain, mix_effect)
+       end
 
        chain:finalize(hq)
 
@@ -194,19 +212,16 @@ local simple_chains = make_cartesian_product({
        return make_simple_chain(input_deint, input_scale, has_overlay, hq)
 end)
 
--- A chain to show a single static picture on screen.
+-- A chain to show a single static picture on screen. Never with CasparCG overlay.
 local static_chains = make_cartesian_product({
-       {true, false},           -- has_overlay
        {true, false}            -- hq
-}, function(has_overlay, hq)
+}, function(hq)
        local chain = EffectChain.new(16, 9)
        local chain_input = chain:add_effect(ImageInput.new("tfk_pause.png"))
-       local overlay = possibly_make_overlay(has_overlay, chain, chain_input)
 
        chain:finalize(hq)
        return {
-               chain = chain,
-               overlay = overlay
+               chain = chain
        }
 end)
 
@@ -621,7 +636,7 @@ function get_chain(num, t, width, height, signals)
                        end
                        return chain.chain, prepare
                elseif live_signal_num == STATIC_SIGNAL_NUM then  -- Static picture.
-                       local chain = static_chains[overlay_enabled][true]
+                       local chain = static_chains[true]
                        prepare = function()
                                prepare_overlay_live(chain, t)
                        end
@@ -663,7 +678,7 @@ function get_chain(num, t, width, height, signals)
                return chain.chain, prepare
        end
        if num == STATIC_SIGNAL_NUM + 2 then
-               local chain = static_chains[show_overlay][false]
+               local chain = static_chains[false]
                prepare = function()
                        prepare_overlay_static(chain, t)
                end