summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-06-18 16:11:25 +0200
committerDamiano Galassi <[email protected]>2017-06-18 16:11:25 +0200
commitf318325dc8a2665f10d5b8b9d0bafa66e172edf2 (patch)
treecd8bc41bb47ac5c01c1862e425c6505393be005b
parent61db4e4b28df18dc17917a8d89ba7238ebaf4989 (diff)
MacGui: Add checkbox for Legacy A/V alignment behaviour for players that don't support MP4 Edit Lists. #778
-rw-r--r--macosx/English.lproj/MainWindow.xib30
-rw-r--r--macosx/HBJob+HBJobConversion.m6
-rw-r--r--macosx/HBJob.h2
-rw-r--r--macosx/HBJob.m16
4 files changed, 47 insertions, 7 deletions
diff --git a/macosx/English.lproj/MainWindow.xib b/macosx/English.lproj/MainWindow.xib
index 3b1d50aab..efdb994a2 100644
--- a/macosx/English.lproj/MainWindow.xib
+++ b/macosx/English.lproj/MainWindow.xib
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12117" systemVersion="16E189a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13122.17" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
- <development version="7000" identifier="xcode"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12117"/>
+ <development version="8000" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13122.17"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HBController">
@@ -444,8 +445,8 @@
</binding>
</connections>
</button>
- <button id="4967">
- <rect key="frame" x="388" y="401" width="126" height="18"/>
+ <button misplaced="YES" id="4967">
+ <rect key="frame" x="496" y="401" width="126" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<string key="toolTip">Add a special MP4 marker to allow playback on vintage iPod 5th Generation devices circa 2006. Other settings may affect compatibility.</string>
<buttonCell key="cell" type="check" title="iPod 5G support" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="4968">
@@ -461,6 +462,23 @@
</binding>
</connections>
</button>
+ <button misplaced="YES" id="sdn-Gd-gTV">
+ <rect key="frame" x="382" y="401" width="107" height="18"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <string key="toolTip">Aligns the initial timestamps of all audio and video streams by inserting blank frames or dropping frames. May improve audio/video sync for broken players that do not honor MP4 edit lists.</string>
+ <buttonCell key="cell" type="check" title="Align A/V Start" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="mvs-91-C88">
+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+ <font key="font" metaFont="smallSystem"/>
+ </buttonCell>
+ <connections>
+ <binding destination="-2" name="hidden" keyPath="self.job.mp4OptionsEnabled" id="ZrC-0O-04k">
+ <dictionary key="options">
+ <string key="NSValueTransformerName">NSNegateBoolean</string>
+ </dictionary>
+ </binding>
+ <binding destination="-2" name="value" keyPath="self.job.alignAVStart" id="sxJ-8V-e06"/>
+ </connections>
+ </button>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="5505">
<rect key="frame" x="648" y="510" width="56" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
@@ -657,7 +675,7 @@ Blu-ray and DVD sources often have multiple titles, the longest of which is typi
<popUpButton key="view" misplaced="YES" imageHugsTitle="YES" id="pJJ-0V-TQq">
<rect key="frame" x="28" y="14" width="58" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
- <popUpButtonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" alignment="center" lineBreakMode="truncatingTail" state="on" inset="2" pullsDown="YES" id="BAK-n3-eIN">
+ <popUpButtonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="addqueue" alignment="center" lineBreakMode="truncatingTail" state="on" inset="2" pullsDown="YES" id="BAK-n3-eIN">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="QCi-1O-Msg">
diff --git a/macosx/HBJob+HBJobConversion.m b/macosx/HBJob+HBJobConversion.m
index 3a28629a9..e67f39cf8 100644
--- a/macosx/HBJob+HBJobConversion.m
+++ b/macosx/HBJob+HBJobConversion.m
@@ -83,9 +83,13 @@
job->mux = self.container;
job->vcodec = self.video.encoder;
- // We set http optimized mp4 here
job->mp4_optimize = self.mp4HttpOptimize;
+ if (self.container & HB_MUX_MASK_MP4)
+ {
+ job->align_av_start = self.alignAVStart;
+ }
+
// We set the chapter marker extraction here based on the format being
// mpeg4 or mkv and the checkbox being checked.
if (self.chaptersEnabled)
diff --git a/macosx/HBJob.h b/macosx/HBJob.h
index 66a42ccec..e77dd346e 100644
--- a/macosx/HBJob.h
+++ b/macosx/HBJob.h
@@ -70,8 +70,10 @@ typedef NS_ENUM(NSUInteger, HBJobState){
@property (nonatomic, readwrite) int container;
@property (nonatomic, readwrite) int angle;
+// Container options
@property (nonatomic, readwrite) BOOL mp4HttpOptimize;
@property (nonatomic, readwrite) BOOL mp4iPodCompatible;
+@property (nonatomic, readwrite) BOOL alignAVStart;
@property (nonatomic, readonly) HBRange *range;
@property (nonatomic, readonly) HBVideo *video;
diff --git a/macosx/HBJob.m b/macosx/HBJob.m
index 35015f511..8c672445e 100644
--- a/macosx/HBJob.m
+++ b/macosx/HBJob.m
@@ -98,6 +98,8 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
self.mp4HttpOptimize = [preset[@"Mp4HttpOptimize"] boolValue];
self.mp4iPodCompatible = [preset[@"Mp4iPodCompatible"] boolValue];
+ self.alignAVStart = [preset[@"AlignAVStart"] boolValue];
+
// Chapter Markers
self.chaptersEnabled = [preset[@"ChapterMarkers"] boolValue];
@@ -118,6 +120,8 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
preset[@"Mp4HttpOptimize"] = @(self.mp4HttpOptimize);
preset[@"Mp4iPodCompatible"] = @(self.mp4iPodCompatible);
+ preset[@"AlignAVStart"] = @(self.alignAVStart);
+
[@[self.video, self.filters, self.picture, self.audio, self.subtitles] makeObjectsPerformSelector:@selector(writeToPreset:)
withObject:preset];
}
@@ -208,6 +212,15 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
_mp4HttpOptimize = mp4HttpOptimize;
}
+- (void)setAlignAVStart:(BOOL)alignAVStart
+{
+ if (alignAVStart != _alignAVStart)
+ {
+ [[self.undo prepareWithInvocationTarget:self] setAlignAVStart:_alignAVStart];
+ }
+ _alignAVStart = alignAVStart;
+}
+
- (void)setMp4iPodCompatible:(BOOL)mp4iPodCompatible
{
if (mp4iPodCompatible != _mp4iPodCompatible)
@@ -291,6 +304,7 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
copy->_angle = _angle;
copy->_mp4HttpOptimize = _mp4HttpOptimize;
copy->_mp4iPodCompatible = _mp4iPodCompatible;
+ copy->_alignAVStart = _alignAVStart;
copy->_range = [_range copy];
copy->_video = [_video copy];
@@ -357,6 +371,7 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
encodeInt(_angle);
encodeBool(_mp4HttpOptimize);
encodeBool(_mp4iPodCompatible);
+ encodeBool(_alignAVStart);
encodeObject(_range);
encodeObject(_video);
@@ -416,6 +431,7 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
decodeInt(_angle);
decodeBool(_mp4HttpOptimize);
decodeBool(_mp4iPodCompatible);
+ decodeBool(_alignAVStart);
decodeObjectOrFail(_range, HBRange);
decodeObjectOrFail(_video, HBVideo);