X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fultimate.lua;h=586b36d7223cb0b29fc6de1d24dd85aa4d45fa55;hb=3c3a5c028bed3922840a2b5ad7ab861fca092582;hp=771a86369602dcb9eea9d04e5bef706c60578850;hpb=96c8163a12e51a15faa81d3e48b80db029a408fb;p=ultimatescore diff --git a/nageru/ultimate.lua b/nageru/ultimate.lua index 771a863..586b36d 100644 --- a/nageru/ultimate.lua +++ b/nageru/ultimate.lua @@ -103,7 +103,7 @@ function make_fade_input(chain, signal, live, deint, scale) input:connect_signal(signal) last = input else - input = chain:add_effect(ImageInput.new("tfk_pause.png")) + input = chain:add_effect(ImageInput.new(cef_path .. "/nageru/dsn-bg.png")) last = input end @@ -297,7 +297,7 @@ local static_chains = make_cartesian_product({ {true, false} -- hq }, function(hq) local chain = EffectChain.new(16, 9) - local chain_input = chain:add_effect(ImageInput.new("tfk_pause.png")) + local chain_input = chain:add_effect(ImageInput.new(cef_path .. "/nageru/dsn-bg.png")) chain:finalize(hq) return { @@ -693,6 +693,8 @@ function get_sbs_chain(signals, t, width, height, input_resolution) return sbs_chains[input0_type][overlay_enabled][input1_type][true] end +local last_rate = 0.0 + -- API ENTRY POINT -- Called every frame. Get the chain for displaying at input , -- where 0 is live, 1 is preview, 2 is the first channel to display @@ -746,12 +748,18 @@ function get_chain(num, t, width, height, signals) last_resolution = input_resolution -- Save some CPU time if we're not having SBS on live. + local new_rate if live_signal_num == SBS_SIGNAL_NUM or preview_signal_num == SBS_SIGNAL_NUM or transition_type == ZOOM_TRANSITION then - bg_video:change_rate(1.0) + new_rate = 1.0 else - bg_video:change_rate(0.0001) + new_rate = 0.0001 + end + if new_rate ~= last_rate then + -- Avoid waking up the video thread (which may be sleeping) if the rate is the same. + bg_video:change_rate(new_rate) + last_rate = new_rate end if num == 0 then -- Live.