fix: pin mpv speed every playback tick so it can't drift to half
The x2/x4 toggle always derives the right speed (1/2/4), but mpv's speed could still drift out of sync during the ab-loop playback (e.g. across loop seeks), making it feel half-speed after x2 -> x4 -> x2. Reassert the desired speed on each render tick while playing so mpv always matches the buttons. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2890,6 +2890,13 @@ class MpvWidget(QWidget):
|
|||||||
tp = self._player.time_pos
|
tp = self._player.time_pos
|
||||||
if tp is not None:
|
if tp is not None:
|
||||||
self.time_pos_changed.emit(tp)
|
self.time_pos_changed.emit(tp)
|
||||||
|
# Pin mpv's speed to the desired value — it can otherwise drift out
|
||||||
|
# of sync (e.g. across ab-loop seeks) and feel like half-speed.
|
||||||
|
try:
|
||||||
|
if abs((self._player.speed or 1.0) - self._speed) > 1e-6:
|
||||||
|
self._player.speed = self._speed
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
if self._wid_mode and self._overlay_widget and self._overlays:
|
if self._wid_mode and self._overlay_widget and self._overlays:
|
||||||
self._overlay_widget.update()
|
self._overlay_widget.update()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user