]> granicus.if.org Git - handbrake/commitdiff
MacGui: try to fix an hang on Sierra.
authorDamiano Galassi <damiog@gmail.com>
Sat, 5 Jan 2019 08:53:16 +0000 (09:53 +0100)
committerDamiano Galassi <damiog@gmail.com>
Sat, 5 Jan 2019 08:53:16 +0000 (09:53 +0100)
macosx/Base.lproj/Video.xib
macosx/HBVideoController.m

index 8bd3cd26283f6e3710737df825b110ba2ce2bc1b..062e8b45f1a90b96649b67b9d7c0cf74adcce0ec 100644 (file)
                         <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"/>
                             </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>
index 9a99719a54e7d8a8676cf44d0c250f7c49247fb5..5eee2a4f8b3eca9f0792d44e4a4618850ba9c9a3 100644 (file)
@@ -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.