From 21e20f75d62c795f5e437f57068bd14923a45019 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 7 Jun 2019 12:31:36 +0200 Subject: [PATCH] MacGui: don't show fast decode checkbox when the encoder is not x264, fixes #2083. --- macosx/HBVideo+UIAdditions.m | 5 +++++ macosx/HBVideo.m | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/macosx/HBVideo+UIAdditions.m b/macosx/HBVideo+UIAdditions.m index bc38c6081..1b2aef339 100644 --- a/macosx/HBVideo+UIAdditions.m +++ b/macosx/HBVideo+UIAdditions.m @@ -81,6 +81,11 @@ - (BOOL)fastDecodeSupported { + if (self.encoder != HB_VCODEC_X264) + { + return NO; + } + const char * const *tunes = hb_video_encoder_get_tunes(self.encoder); for (int i = 0; tunes != NULL && tunes[i] != NULL; i++) diff --git a/macosx/HBVideo.m b/macosx/HBVideo.m index 21e701bbf..997c88bf7 100644 --- a/macosx/HBVideo.m +++ b/macosx/HBVideo.m @@ -332,6 +332,11 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; if (levels.count && ![levels containsObject:self.level]) { self.level = levels.firstObject; } + + if (self.encoder != HB_VCODEC_X264) + { + self.fastDecode = NO; + } } - (void)validateVideoOptionExtra:(int)previousEncoder @@ -390,7 +395,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; for (int i = 0; tunes != NULL && tunes[i] != NULL; i++) { // we filter out "fastdecode" as we have a dedicated checkbox for it - if (strcasecmp(tunes[i], "fastdecode") != 0) + if (self.encoder != HB_VCODEC_X264 || strcasecmp(tunes[i], "fastdecode") != 0) { [temp addObject:@(tunes[i])]; } -- 2.40.0