From c1162554b4fa4b9b0b1676a70f5c64c9b3bc6553 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Sat, 5 Jan 2019 09:53:16 +0100 Subject: [PATCH] MacGui: try to fix an hang on Sierra. --- macosx/Base.lproj/Video.xib | 33 +++++++++++++-------------------- 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 @@ - - - - - - - - @@ -148,6 +140,14 @@ + + + + + + + + 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. -- 2.40.0