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 <num>,
-- where 0 is live, 1 is preview, 2 is the first channel to display
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.