Skip to content

Commit

Permalink
MacGui: hide the iPod 5g check box if the codec is not h.264.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6678 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
galad87 committed Dec 30, 2014
1 parent df7f224 commit 72531bc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion macosx/English.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
<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>
Expand Down
2 changes: 2 additions & 0 deletions macosx/HBJob+UIAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
@interface HBJob (UIAdditions)

@property (nonatomic, readonly) BOOL mp4OptionsEnabled;
@property (nonatomic, readonly) BOOL mp4iPodCompatibleEnabled;

@property (nonatomic, readonly) NSArray *angles;

@end
Expand Down
14 changes: 6 additions & 8 deletions macosx/HBJob+UIAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ @implementation HBJob (UIAdditions)

- (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
Expand Down
14 changes: 11 additions & 3 deletions macosx/HBJob.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key
retval = [NSSet setWithObjects:@"container", nil];
}

if ([key isEqualToString:@"mp4iPodCompatibleEnabled"])
{
retval = [NSSet setWithObjects:@"container", @"video.encoder", nil];
}

return retval;
}

Expand Down Expand Up @@ -231,18 +236,21 @@ - (hb_job_t *)hb_job
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;
Expand All @@ -260,7 +268,7 @@ - (hb_job_t *)hb_job
}
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];
Expand Down

0 comments on commit 72531bc

Please sign in to comment.