Skip to content

Commit

Permalink
libobs: Only modify raw_active counter if (dis-)connection succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Dec 8, 2024
1 parent 206fb3a commit 6b0dd0b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libobs/obs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2929,17 +2929,15 @@ 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)
if (video && video_output_connect2(v, conversion, frame_rate_divisor, callback, param))
os_atomic_inc_long(&video->raw_active);
video_output_connect2(v, conversion, frame_rate_divisor, callback, param);
}

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)
if (video && video_output_disconnect2(v, callback, param))
os_atomic_dec_long(&video->raw_active);
video_output_disconnect(v, callback, param);
}

void obs_add_raw_video_callback(const struct video_scale_info *conversion,
Expand Down

0 comments on commit 6b0dd0b

Please sign in to comment.