Eisa01 / mpv-scripts

This repository contain scripts I have made for mpv media player...
BSD 2-Clause "Simplified" License
505 stars 35 forks source link

UndoRedo: Handle more than 1x speed #119

Open AziRizvi opened 7 months ago

AziRizvi commented 7 months ago

The behaviour of UndoRedo is very weird. (Not sure if I'm using it wrong, or there are bugs in the script) Script Version: 2.2 MPV Version: v0.37.0-6-g5220725c (Shinchiro's Build)

By default, all my videos start playing at 2.35x playback speed because I've set that up in my mpv.conf.

Now to the issue. Let's say I open a video and it starts playing and let's say it was at 19 seconds in the video when I "accidentally" clicked somewhere on the timeline/seekbar.

When I press Ctrl+Z, it should go back to 19 seconds, correct? But it doesn't.

Here's a short clip. (When the video that I was playing at was at 19 seconds, I clicked on the timeline/seekbar at 45 seconds, then I pressed ctrl+z to undo and instead of going back to 19 seconds, it went back to 7 seconds.)

https://github.com/Eisa01/mpv-scripts/assets/129892077/04e46f5e-cf57-46be-a452-e4e19ae32505

Now to the 2nd issue:

Another issue is, If I keep pressing Ctrl+Alt+Z to keep performing undo and redo between the original position and the position that I clicked at, every time I hit ctrl+alt+z it keeps taking the video back a few milliseconds.

When the video was at 17 seconds, I clicked at 41 seconds and then I pressed Ctrl+Alt+Z and every time I press Ctrl+Alt+Z both the "undo" and the "redo" points in the video keep going back a few milliseconds.

https://github.com/Eisa01/mpv-scripts/assets/129892077/bc1fa390-23c0-42c1-815e-6f56b987c1c2

Eisa01 commented 7 months ago

Ah, seems like the script doesn't handle videos with more than 1x speed. Try the 1x speed and let me know if the issue is still there.

Also for the milliseconds, it is by design. I need to make it optional in user config.

AziRizvi commented 7 months ago

Ah, seems like the script doesn't handle videos with more than 1x speed. Try the 1x speed and let me know if the issue is still there.

Also for the milliseconds, it is by design. I need to make it optional in user config.

I just tried to undo with 1x playback speed and that worked just fine and it sent it back to the correct position, just doesn't work with higher playback speeds.