summaryrefslogtreecommitdiffstats
path: root/osdep/mac
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/mac')
-rw-r--r--osdep/mac/touch_bar.swift5
1 files changed, 4 insertions, 1 deletions
diff --git a/osdep/mac/touch_bar.swift b/osdep/mac/touch_bar.swift
index dcebb24970..9ee312fa7a 100644
--- a/osdep/mac/touch_bar.swift
+++ b/osdep/mac/touch_bar.swift
@@ -80,6 +80,7 @@ class TouchBar: NSTouchBar, NSTouchBarDelegate {
var isPaused: Bool = false
var position: Double = 0
var duration: Double = 0
+ var rate: Double = 0
override init() {
super.init()
@@ -326,7 +327,7 @@ class TouchBar: NSTouchBar, NSTouchBarDelegate {
switch String(cString: property.name) {
case "time-pos" where property.format == MPV_FORMAT_DOUBLE:
let newPosition = max(LibmpvHelper.mpvDoubleToDouble(property.data) ?? 0, 0)
- if Int(floor(newPosition) - floor(position)) != 0 {
+ if Int((floor(newPosition) - floor(position)) / rate) != 0 {
position = newPosition
updateTouchBarTimeItems()
}
@@ -336,6 +337,8 @@ class TouchBar: NSTouchBar, NSTouchBarDelegate {
case "pause" where property.format == MPV_FORMAT_FLAG:
isPaused = LibmpvHelper.mpvFlagToBool(property.data) ?? false
updatePlayButton()
+ case "speed" where property.format == MPV_FORMAT_DOUBLE:
+ rate = LibmpvHelper.mpvDoubleToDouble(property.data) ?? 1
default:
break
}