From fb5bbc8575af8beeba1d471b8b77012a617ddbd0 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 19 Jun 2024 15:45:42 -0700 Subject: [PATCH] libobs: Set encoder initialized call closer to shutdown This is mainly code cleanup. --- libobs/obs-encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libobs/obs-encoder.c b/libobs/obs-encoder.c index c90786a09..b110eb7ce 100644 --- a/libobs/obs-encoder.c +++ b/libobs/obs-encoder.c @@ -371,6 +371,8 @@ static void remove_connection(struct obs_encoder *encoder, bool shutdown) * up again */ if (shutdown) obs_encoder_shutdown(encoder); + encoder->initialized = false; + set_encoder_active(encoder, false); } @@ -810,7 +812,6 @@ static inline bool obs_encoder_stop_internal( if (last) { remove_connection(encoder, true); - encoder->initialized = false; if (encoder->destroy_on_stop) { pthread_mutex_unlock(&encoder->init_mutex); @@ -1334,7 +1335,6 @@ void full_stop(struct obs_encoder *encoder) pthread_mutex_unlock(&encoder->callbacks_mutex); remove_connection(encoder, false); - encoder->initialized = false; } }