From fffb3202253c9e3d305a6a858e363cea00a3c488 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Wed, 22 Jun 2022 03:02:32 +0200 Subject: [PATCH] mac-videotoolbox: Remove redundant bitrate check The session_set_bitrate method already returns an OSStatus to confirm that everything has been successful. As such, a second check to make sure that the bitrate has indeed changed is redundant and only adds unnecessary code. --- plugins/mac-videotoolbox/encoder.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/plugins/mac-videotoolbox/encoder.c b/plugins/mac-videotoolbox/encoder.c index 7d0b67c75..dda71dc9e 100644 --- a/plugins/mac-videotoolbox/encoder.c +++ b/plugins/mac-videotoolbox/encoder.c @@ -461,23 +461,7 @@ static bool vt_update(void *data, obs_data_t *settings) enc->rc_max_bitrate, enc->rc_max_bitrate_window); if (code != noErr) - VT_BLOG(LOG_WARNING, "failed to set bitrate to session"); - - CFNumberRef n; - VTSessionCopyProperty(enc->session, - kVTCompressionPropertyKey_AverageBitRate, NULL, - &n); - - uint32_t session_bitrate; - CFNumberGetValue(n, kCFNumberIntType, &session_bitrate); - CFRelease(n); - - if (session_bitrate == old_bitrate) { - VT_BLOG(LOG_WARNING, - "failed to update current session " - " bitrate from %d->%d", - old_bitrate, enc->bitrate); - } + VT_BLOG(LOG_WARNING, "Failed to set bitrate to session"); dump_encoder_info(enc); return true;