-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Keybindings for seek exact
are silently overridden to seek keyframes
#3710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did not reproduce for me? Could you post the offending key binding configuration file? In I tried the following:
Checking the mpv log shows:
Possibly this is related to issue #3692. The fix for that is in PR #3693 which is waiting to be reviewed and merged. The hardcoding of the menu items to 5s is correct. What should happen is that if the command assigned to the key that is bound to the menu item changes, the key should not be bound as a shortcut to the menu item. I am unsure as to whether this is the problem in issue #3692 or not. If you post the offending configuration I will give it a try and see what is going on. |
MattMPV.conf.txt |
Reproduced. Also reproduced with the fix for issue #3692. Thanks for posting the file. I need to take a close look into what is going on. Caught me super busy. Need to clear a couple of things off my plate. Should be able to dig into this one later this week. |
I've been doing some more digging, and I think I might be able to fix it. It looks like it will mostly involve unwinding some tangled up code in MenuController.swift. Mind if I take a crack at it? Seems like you've got plenty on your plate already and I've love to contribute. And it might be easier just to show a diff than even try to explain it. |
I don't mind at all. It is yours to fix. Thanks for stepping up! Let us know if you get too busy and need to drop it. I'm pretty sure my earlier comments on this one were wrong. I've not spent much time in this area of the code. |
@svobs |
@sanchezelton I tried with a few MKVs I've got, but generally I found that the seek step was longer than requested, not shorter. This makes sense because from what I understand about the MPV engine, its default "keyframes" mode first jumps the video by the requested amount and then starts seeking forward more until it finds the nearest keyframe. And in general for more highly compressed files, the farther apart keyframes are. What you're describing sounds more like #3692 - if you have the same key binding listed twice, it might be that one of them is getting ignored. If you can post your binding config file, I can take a look (In IINA > Preferences > Key Bindings there is a "Reveal config file in Finder" button that will open the directory containing the file). |
In addition to now using the exact seek step specified , the fix adds support for users specifying "exact" (which ends up being sent to MPV as "relative+exact"), and "keyframes" (which is sent to MPV as "relative", which is fine because "keyframes" is implied). This is due to having to map to IINA's internal enums, which don't support all the possible flags such as "relative-percent" (does anyone even use that?). More work is needed in this area in order to add more support for all of MPV's possible values. |
I just want to add that most strings in iina/iina/Base.lproj/Localizable.strings Line 119 in 9427486
|
seek exact
are silently overridden to seek keyframes
This commit will: - Change MenuController.sameKeyAction to detect the exact flag and pass it on as extra data - Change MainMenuActionHandler.menuStep to pass the extra data to PlayerCore.seek if present The main author of these changes is Matt Svoboda. I merely addressed some review comments. Co-authored-by: Matt Svoboda <matt.svoboda@gmail.com>
This commit will: - Change MenuController.sameKeyAction to detect the exact flag and pass it on as extra data - Change MainMenuActionHandler.menuStep to pass the extra data to PlayerCore.seek if present The main author of these changes is Matt Svoboda. I merely addressed some review comments. Co-authored-by: Matt Svoboda <matt.svoboda@gmail.com>
The fix for this issue has been merged into the IINA |
This was fixed in IINA 1.3.5. |
I was playing with building IINA myself, and was tailing the MPV log, and discovered some issues with seek keybindings.
In IINA's Key Bindings config, I've got the L key bound to "seek 10 exact", and the J key bound to "seek -10 exact". But looking at the commands MPV is logging:
I noticed that to some extent this is a feature: I see "Step Forward 10s" and "Step Backward 10s" with my key bindings listed in the Playback menu. But the MPV logs were not lying, and I managed to trace part of the problem to hard-coded values in MainMenuActions.swift:
In addition, there appear to be several menu localizations which have the 5s value hard-coded. For example, MainMenu.strings (it):
I did some further testing and discovered that this override is enabled for any value I choose between 5s and 10s, and between -5s and -10s. If I set it outside of that range (e.g. "seek 15 exact", there is no override and MPV receives exactly what I specified. I haven't yet been able to find the place in the code where this override logic resides, but it needs to be changed to include the step amount and the seek option in order to honor the user's wishes.
Having the "relative" option hard-coded has doubtlessly led to user confusion, because what MPV ends up actually seeking seems to vary enormously based on the file and location inside it and can end up appearing random (the above log snippit is a good example).
This may be the underlying problem for issues #3110, #3321, #3440, #3534.
EDIT: also issues #2963, #3918, #4766.
System and IINA version:
The text was updated successfully, but these errors were encountered: