From: Damiano Galassi Date: Sat, 31 Dec 2016 08:06:58 +0000 (+0100) Subject: MacGui: reset the video encoder additional options when switching to a different... X-Git-Tag: 1.1.0~826 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ba75322da188f3e44591908649df96af39fd3c3;p=handbrake MacGui: reset the video encoder additional options when switching to a different encoder. --- diff --git a/macosx/HBVideo.m b/macosx/HBVideo.m index 26a45c239..5cb7d642d 100644 --- a/macosx/HBVideo.m +++ b/macosx/HBVideo.m @@ -94,6 +94,8 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; - (void)setEncoder:(int)encoder { + int previousEncoder = _encoder; + if (encoder != _encoder) { [[self.undo prepareWithInvocationTarget:self] setEncoder:_encoder]; @@ -105,6 +107,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; { [self validatePresetsSettings]; [self validateAdvancedOptions]; + [self validateVideoOptionExtra:previousEncoder]; } [self postChangedNotification]; @@ -310,6 +313,17 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; } } +- (void)validateVideoOptionExtra:(int)previousEncoder +{ + if (!((previousEncoder & HB_VCODEC_X264_MASK && + self.encoder & HB_VCODEC_X264_MASK) || + (previousEncoder & HB_VCODEC_X265_MASK && + self.encoder & HB_VCODEC_X265_MASK))) + { + self.videoOptionExtra = @""; + } +} + - (void)setNilValueForKey:(NSString *)key { [self setValue:@0 forKey:key];