diff options
author | Damiano Galassi <[email protected]> | 2019-01-05 09:53:16 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-01-05 09:53:16 +0100 |
commit | c1162554b4fa4b9b0b1676a70f5c64c9b3bc6553 (patch) | |
tree | 48b131c5f2310e1dca7180b6049e2057d31103cb | |
parent | 92e8e81de2d5c5fe29e30d7d2004507a9811cba8 (diff) |
MacGui: try to fix an hang on Sierra.
-rw-r--r-- | macosx/Base.lproj/Video.xib | 33 | ||||
-rw-r--r-- | macosx/HBVideoController.m | 9 |
2 files changed, 18 insertions, 24 deletions
diff --git a/macosx/Base.lproj/Video.xib b/macosx/Base.lproj/Video.xib index 8bd3cd262..062e8b45f 100644 --- a/macosx/Base.lproj/Video.xib +++ b/macosx/Base.lproj/Video.xib @@ -125,14 +125,6 @@ <font key="font" metaFont="smallSystem"/> </buttonCell> <connections> - <binding destination="-2" name="enabled3" keyPath="self.video.twoPassSupported" previousBinding="c4g-dz-q05" id="rwS-GN-5Dd"> - <dictionary key="options"> - <integer key="NSMultipleValuesPlaceholder" value="-1"/> - <integer key="NSNoSelectionPlaceholder" value="-1"/> - <integer key="NSNotApplicablePlaceholder" value="-1"/> - <integer key="NSNullPlaceholder" value="-1"/> - </dictionary> - </binding> <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="7aV-7j-MzB" id="c4g-dz-q05"> <dictionary key="options"> <integer key="NSMultipleValuesPlaceholder" value="-1"/> @@ -148,6 +140,14 @@ </dictionary> </binding> <binding destination="-2" name="value" keyPath="self.video.twoPass" id="mOJ-b3-YKx"/> + <binding destination="-2" name="enabled3" keyPath="self.video.twoPassSupported" previousBinding="c4g-dz-q05" id="rwS-GN-5Dd"> + <dictionary key="options"> + <integer key="NSMultipleValuesPlaceholder" value="-1"/> + <integer key="NSNoSelectionPlaceholder" value="-1"/> + <integer key="NSNotApplicablePlaceholder" value="-1"/> + <integer key="NSNullPlaceholder" value="-1"/> + </dictionary> + </binding> </connections> </button> <button toolTip="Turbo first pass speeds up the first pass of a 2-pass encode for a slight penalty to analysis." translatesAutoresizingMaskIntoConstraints="NO" id="olm-zg-k9Y"> @@ -270,13 +270,6 @@ x264 is lossless at RF 0.</string> <integer key="NSNullPlaceholder" value="-1"/> </dictionary> </binding> - <binding destination="-2" name="value" keyPath="self.video.quality" previousBinding="nAO-gB-Jbd" id="C3d-pR-fJ2"> - <dictionary key="options"> - <string key="NSValueTransformerName">HBQualityTransformer</string> - </dictionary> - </binding> - <binding destination="-2" name="maxValue" keyPath="self.video.qualityMaxValue" id="FrR-GV-xnx"/> - <binding destination="-2" name="minValue" keyPath="self.video.qualityMinValue" previousBinding="FrR-GV-xnx" id="nAO-gB-Jbd"/> <binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="wCA-ag-GHJ"/> </connections> </slider> @@ -307,6 +300,11 @@ x264 is lossless at RF 0.</string> <font key="font" metaFont="smallSystem"/> </buttonCell> <connections> + <binding destination="-2" name="enabled" keyPath="self.video" id="Ewd-OO-T3Z"> + <dictionary key="options"> + <string key="NSValueTransformerName">NSIsNotNil</string> + </dictionary> + </binding> <binding destination="-2" name="enabled2" keyPath="self.video.isConstantQualitySupported" previousBinding="Ewd-OO-T3Z" id="cEw-6S-gon"> <dictionary key="options"> <integer key="NSMultipleValuesPlaceholder" value="-1"/> @@ -315,11 +313,6 @@ x264 is lossless at RF 0.</string> <integer key="NSNullPlaceholder" value="-1"/> </dictionary> </binding> - <binding destination="-2" name="enabled" keyPath="self.video" id="Ewd-OO-T3Z"> - <dictionary key="options"> - <string key="NSValueTransformerName">NSIsNotNil</string> - </dictionary> - </binding> <binding destination="-2" name="value" keyPath="self.video.qualityType" id="X1H-PE-sRI"/> </connections> </button> diff --git a/macosx/HBVideoController.m b/macosx/HBVideoController.m index 9a99719a5..5eee2a4f8 100644 --- a/macosx/HBVideoController.m +++ b/macosx/HBVideoController.m @@ -196,8 +196,8 @@ static void *HBVideoControllerContext = &HBVideoControllerContext; */ - (void)setupQualitySlider { - int direction; - float minValue, maxValue, granularity; + int direction = 1; + float minValue = 0, maxValue = 0, granularity = 0; [self.video qualityLimitsForEncoder:self.video.encoder low:&minValue high:&maxValue granularity:&granularity direction:&direction]; if (granularity < 1.0f) @@ -209,8 +209,9 @@ static void *HBVideoControllerContext = &HBVideoControllerContext; } fVidQualitySlider.minValue = minValue; fVidQualitySlider.maxValue = maxValue; - [fVidQualitySlider setNumberOfTickMarks:(int)((maxValue - minValue) * - (1.0f / granularity)) + 1]; + + NSInteger numberOfTickMarks = (NSInteger)((maxValue - minValue) * (1.0f / granularity)) + 1; + fVidQualitySlider.numberOfTickMarks = numberOfTickMarks; // Replace the slider transformer with a new one, // configured with the new max/min/direction values. |