From 46db6cd2bae51be83ff3d4bc244b49cc660cd843 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 19 Jun 2024 16:30:34 -0700 Subject: [PATCH] libobs: Merge `obs_encoder_stop()` and `..._stop_internal()` No longer any need for them to be separate functions. This is just code cleanup --- libobs/obs-encoder.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/libobs/obs-encoder.c b/libobs/obs-encoder.c index 6c5253cc7567be..29c7ded0391044 100644 --- a/libobs/obs-encoder.c +++ b/libobs/obs-encoder.c @@ -856,14 +856,19 @@ void obs_encoder_start(obs_encoder_t *encoder, pthread_mutex_unlock(&encoder->init_mutex); } -static inline void obs_encoder_stop_internal( - obs_encoder_t *encoder, - void (*new_packet)(void *param, struct encoder_packet *packet), - void *param) +void obs_encoder_stop(obs_encoder_t *encoder, + void (*new_packet)(void *param, + struct encoder_packet *packet), + void *param) { bool last = false; size_t idx; + if (!obs_encoder_valid(encoder, "obs_encoder_stop")) + return; + if (!obs_ptr_valid(new_packet, "obs_encoder_stop")) + return; + pthread_mutex_lock(&encoder->init_mutex); pthread_mutex_lock(&encoder->callbacks_mutex); @@ -910,21 +915,6 @@ static inline void obs_encoder_stop_internal( pthread_mutex_unlock(&encoder->init_mutex); } -void obs_encoder_stop(obs_encoder_t *encoder, - void (*new_packet)(void *param, - struct encoder_packet *packet), - void *param) -{ - bool destroyed; - - if (!obs_encoder_valid(encoder, "obs_encoder_stop")) - return; - if (!obs_ptr_valid(new_packet, "obs_encoder_stop")) - return; - - obs_encoder_stop_internal(encoder, new_packet, param); -} - const char *obs_encoder_get_codec(const obs_encoder_t *encoder) { return obs_encoder_valid(encoder, "obs_encoder_get_codec")