Skip to content

Commit

Permalink
Round the frame rate to a whole number
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 2, 2019
1 parent 2328686 commit 92fed87
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Gifski/EditVideoViewController.swift
Expand Up @@ -246,8 +246,11 @@ final class EditVideoViewController: NSViewController {
self.estimateFileSize()
}

frameRateSlider.maxValue = videoMetadata.frameRate.clamped(to: Constants.allowedFrameRate)
frameRateSlider.doubleValue = defaultFrameRate(inputFrameRate: videoMetadata.frameRate)
// We round it so that `29.970` becomes `30` for practical reasons.
let frameRate = videoMetadata.frameRate.rounded()

frameRateSlider.maxValue = frameRate.clamped(to: Constants.allowedFrameRate)
frameRateSlider.doubleValue = defaultFrameRate(inputFrameRate: frameRate)
frameRateSlider.triggerAction()

qualitySlider.doubleValue = Defaults[.outputQuality]
Expand Down

0 comments on commit 92fed87

Please sign in to comment.