From 46ce91e5825b4284bef60c672ed14eabd5e57831 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 12 Jul 2025 22:32:28 +0200 Subject: [PATCH] libobs: Start video output even if there is no mix This fixes a change in PR 11605 that breaks Decklink video outputs. get_mix_for_video() returns NULL for those outputs, causing start_raw_video() to return before connecting the output. --- libobs/obs.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libobs/obs.c b/libobs/obs.c index 51fa5dc4c..15a1c475c 100644 --- a/libobs/obs.c +++ b/libobs/obs.c @@ -3047,18 +3047,22 @@ void start_raw_video(video_t *v, const struct video_scale_info *conversion, uint void (*callback)(void *param, struct video_data *frame), void *param) { struct obs_core_video_mix *video = get_mix_for_video(v); - if (!video) - return; - if (video_output_connect2(v, conversion, frame_rate_divisor, callback, param)) + + // TODO: Make affected outputs use views/canvasses, and revert this later. + // https://github.com/obsproject/obs-studio/pull/12379 + // https://github.com/obsproject/obs-studio/issues/12366 + if (video_output_connect2(v, conversion, frame_rate_divisor, callback, param) && video) os_atomic_inc_long(&video->raw_active); } void stop_raw_video(video_t *v, void (*callback)(void *param, struct video_data *frame), void *param) { struct obs_core_video_mix *video = get_mix_for_video(v); - if (!video) - return; - if (video_output_disconnect2(v, callback, param)) + + // TODO: Make affected outputs use views/canvasses, and revert this later. + // https://github.com/obsproject/obs-studio/pull/12379 + // https://github.com/obsproject/obs-studio/issues/12366 + if (video_output_disconnect2(v, callback, param) && video) os_atomic_dec_long(&video->raw_active); }