OSDN Git Service

MacGui: Make Legacy iPod presets truly backwards compatible
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 22 Jan 2008 15:33:02 +0000 (15:33 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 22 Jan 2008 15:33:02 +0000 (15:33 +0000)
- Preset code now adds "level=30" to the advanced options string if the deprecated "x264 (h.264 iPod)" is detected as encoder in a legacy preset.

git-svn-id: svn://localhost/HandBrake/trunk@1221 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm

index 4fca24a..76a40e6 100644 (file)
@@ -3346,7 +3346,10 @@ if (item == nil)
         /* Codecs */
         [fDstCodecsPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"FileCodecs"]]];
         [self codecsPopUpChanged: NULL];
+        
         /* Video encoder */
+        /* We set the advanced opt string here if applicable*/
+        [fAdvancedOptions setOptions: [NSString stringWithFormat:[chosenPreset valueForKey:@"x264Option"]]];
         /* We use a conditional to account for the new x264 encoder dropdown as well as presets made using legacy x264 settings*/
         if ([[NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]] isEqualToString: @"x264 (h.264 Main)"] || [[NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]] isEqualToString: @"x264 (h.264 iPod)"])
         {
@@ -3355,10 +3358,13 @@ if (item == nil)
             if ([[NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]] isEqualToString: @"x264 (h.264 iPod)"])
             {
                 [fDstMp4iPodFileCheck setState:NSOnState];
+                /* We also need to add "level=30:" to the advanced opts string to set the correct level for the iPod when
+                 encountering a legacy preset as it used to be handled separately from the opt string*/
+                [fAdvancedOptions setOptions: [NSString stringWithFormat:[@"level=30:" stringByAppendingString:[fAdvancedOptions optionsString]]]];
             }
             else
             {
-            [fDstMp4iPodFileCheck setState:NSOffState];
+                [fDstMp4iPodFileCheck setState:NSOffState];
             }
         }
         else
@@ -3366,11 +3372,6 @@ if (item == nil)
             [fVidEncoderPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]]];
         }
         
-        
-        /* We can show the preset options here in the gui if we want to
-         so we check to see it the user has specified it in the prefs */
-        [fAdvancedOptions setOptions: [NSString stringWithFormat:[chosenPreset valueForKey:@"x264Option"]]];
-        
         /* Lets run through the following functions to get variables set there */
         [self encoderPopUpChanged: NULL];