]> granicus.if.org Git - handbrake/commitdiff
MacGui: hide the iPod 5g check box if the codec is not h.264.
authorritsuka <damiog@gmail.com>
Tue, 30 Dec 2014 08:32:05 +0000 (08:32 +0000)
committerritsuka <damiog@gmail.com>
Tue, 30 Dec 2014 08:32:05 +0000 (08:32 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6678 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/English.lproj/MainMenu.xib
macosx/HBJob+UIAdditions.h
macosx/HBJob+UIAdditions.m
macosx/HBJob.m

index 55b60f03f3a88bf283c995e923e63eb52402e703..13e98f79dc525f0bd81bfa93724a7d1d616fc6ed 100644 (file)
                             <font key="font" metaFont="smallSystem"/>
                         </buttonCell>
                         <connections>
-                            <binding destination="240" name="hidden" keyPath="self.job.mp4OptionsEnabled" id="Vlg-uB-45p">
+                            <binding destination="240" name="hidden" keyPath="self.job.mp4iPodCompatibleEnabled" id="eGS-R2-zSV">
                                 <dictionary key="options">
                                     <string key="NSValueTransformerName">NSNegateBoolean</string>
                                 </dictionary>
index 0d1e315d3f06382fd5077595e0715dc00a1765d7..a8adc4f25dc1b114ef1bf9ab41eabcd5215d3e89 100644 (file)
@@ -10,6 +10,8 @@
 @interface HBJob (UIAdditions)
 
 @property (nonatomic, readonly) BOOL mp4OptionsEnabled;
+@property (nonatomic, readonly) BOOL mp4iPodCompatibleEnabled;
+
 @property (nonatomic, readonly) NSArray *angles;
 
 @end
index 509668e1720ddff36020ea128e13a4ff3af1b74f..e328c95c03fd46ffbf75a3b37aad1e94adf2e831 100644 (file)
 
 - (BOOL)mp4OptionsEnabled
 {
-    if (self.container & HB_MUX_MASK_MP4)
-    {
-        return YES;
-    }
-    else
-    {
-        return NO;
-    }
+    return ((self.container & HB_MUX_MASK_MP4) != 0);
+}
+
+- (BOOL)mp4iPodCompatibleEnabled
+{
+    return ((self.container & HB_MUX_MASK_MP4) != 0) && (self.video.encoder & HB_VCODEC_H264_MASK);
 }
 
 - (NSArray *)angles
index dccd9434cda9898c293edeb57ca57bbb6f828cdb..3e0c8e3ecf6b34f59b32d0e47cd46dc91448517f 100644 (file)
@@ -128,6 +128,11 @@ NSString *keyContainerTag                      = @"keyContainerTag";
         retval = [NSSet setWithObjects:@"container", nil];
     }
 
+    if ([key isEqualToString:@"mp4iPodCompatibleEnabled"])
+    {
+        retval = [NSSet setWithObjects:@"container", @"video.encoder", nil];
+    }
+
     return retval;
 }
 
@@ -231,18 +236,21 @@ NSString *keyContainerTag                      = @"keyContainerTag";
         job->chapter_markers = 0;
     }
 
-    if (job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_X265)
+    if (job->vcodec == HB_VCODEC_X264)
     {
         // iPod 5G atom
         job->ipod_atom = self.mp4iPodCompatible;
+    }
 
+    if (job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_X265)
+    {
         // set fastfirstpass if 2-pass and Turbo are enabled
         if (self.video.twoPass)
         {
             job->fastfirstpass = self.video.turboTwoPass;
         }
 
-        // advanced x264 options
+        // advanced x264/x265 options
         NSString   *tmpString;
         // translate zero-length strings to NULL for libhb
         const char *encoder_preset  = NULL;
@@ -260,7 +268,7 @@ NSString *keyContainerTag                      = @"keyContainerTag";
         }
         else
         {
-            // we are using the x264 preset system
+            // we are using the x264/x265 preset system
             if ([(tmpString = self.video.completeTune) length])
             {
                 encoder_tune = [tmpString UTF8String];