]> granicus.if.org Git - handbrake/commitdiff
MacGui: Add checkbox for Legacy A/V alignment behaviour for players that don't suppor...
authorDamiano Galassi <damiog@gmail.com>
Sun, 18 Jun 2017 14:11:25 +0000 (16:11 +0200)
committerDamiano Galassi <damiog@gmail.com>
Sun, 18 Jun 2017 14:11:25 +0000 (16:11 +0200)
macosx/English.lproj/MainWindow.xib
macosx/HBJob+HBJobConversion.m
macosx/HBJob.h
macosx/HBJob.m

index 3b1d50aab800f6daf03982fa1c4b59e92efc97cc..efdb994a2dbc634baf350b964725b284589908ee 100644 (file)
@@ -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">
                             </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">
                             </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">
index 3a28629a92f865e31df7969b94caa20269282e26..e67f39cf819138b0de8f8d89970a0ba7b13f6bfa 100644 (file)
     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)
index 66a42ccec0d4367687d4977eea59e9c1e0f7d1d8..e77dd346ecf29769bc5a28959f7148d816da541f 100644 (file)
@@ -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;
index 35015f51188ae191269010c8d83467830013578a..8c672445e3258983d3bf40eb5b8327611d19399b 100644 (file)
@@ -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);