]> granicus.if.org Git - handbrake/commitdiff
MacGui: reset the video encoder additional options when switching to a different...
authorDamiano Galassi <damiog@gmail.com>
Sat, 31 Dec 2016 08:06:58 +0000 (09:06 +0100)
committerDamiano Galassi <damiog@gmail.com>
Sat, 31 Dec 2016 08:06:58 +0000 (09:06 +0100)
macosx/HBVideo.m

index 26a45c239c4842bddd821b9463edabef2bf9a3d5..5cb7d642d56e4d9f432e6b97b8a6b1cea7f2bcaf 100644 (file)
@@ -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];