Description
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:
tail -f /Users/msvoboda/Library/Logs/com.colliderli.iina/2022-05-02-12-49-20_TLOoov/mpv.log | grep -A 1 'Run command: seek'
[ 100.964][d][cplayer] Run command: seek, flags=64, args=["-5.000000", "relative", "unused"]
[ 100.964][v][mkv] queuing seek to 15.854000
--
[ 115.514][d][cplayer] Run command: seek, flags=64, args=["5.000000", "relative", "unused"]
[ 115.514][v][mkv] queuing seek to 15.427000
--
[ 117.548][d][cplayer] Run command: seek, flags=64, args=["5.000000", "relative", "unused"]
[ 117.548][v][mkv] queuing seek to 25.854000
--
[ 119.141][d][cplayer] Run command: seek, flags=64, args=["5.000000", "relative", "unused"]
[ 119.141][v][mkv] queuing seek to 36.281000
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:
@objc func menuStep(_ sender: NSMenuItem) {
if sender.tag == 0 { // -> 5s
player.seek(relativeSecond: 5, option: .relative)
} else if sender.tag == 1 { // <- 5s
player.seek(relativeSecond: -5, option: .relative)
}
}
In addition, there appear to be several menu localizations which have the 5s value hard-coded. For example, MainMenu.strings (it):
/* Class = "NSMenuItem"; title = "Step Forward 5s"; ObjectID = "6yE-op-DTS"; */
"6yE-op-DTS.title" = "Avanti 5s";
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:
- macOS 12.3.1
- IINA 1.2.0
- also confirmed with April 28 build (d0c32125df2269621f0b6a85dabe36120a6d3f3b)