From 7c36257cc0e459a0a3389ac08f4ae5cf560c0341 Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 1 Dec 2023 21:06:25 +0100 Subject: [PATCH] libobs: Fix obs_view_remove only resetting the first matching mix --- libobs/obs-view.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libobs/obs-view.c b/libobs/obs-view.c index a2973c893..43add2634 100644 --- a/libobs/obs-view.c +++ b/libobs/obs-view.c @@ -192,9 +192,10 @@ void obs_view_remove(obs_view_t *view) return; pthread_mutex_lock(&obs->video.mixes_mutex); - size_t idx = find_mix_for_view(view); - if (idx != DARRAY_INVALID) - obs->video.mixes.array[idx]->view = NULL; + for (size_t i = 0, num = obs->video.mixes.num; i < num; i++) { + if (obs->video.mixes.array[i]->view == view) + obs->video.mixes.array[i]->view = NULL; + } set_main_mix(); pthread_mutex_unlock(&obs->video.mixes_mutex); }