-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix lag when scrolling horizontally to seek, #4153 #4276
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
Conversation
See the issue for an analysis of the problem. There one case the proposed fix does not cover. In order to properly support the user sending commands directly to mpv through the IPC interface, control of the display link should be based on events from mpv. This works for seeking: echo '{ "command": ["seek", "5"] }' | socat - /tmp/mpv-socket | jq It does not work for stepping: echo '{ "command": ["frame-step"] }' | socat - /tmp/mpv-socket | jq Directly commanding mpv to step through the IPC interface works, but it does cause mpv to report "mpv_render_report_swap() not being called". This is because the code that insures the display link is working for stepping is in |
This commit will: - Add methods displayActive and displayIdle to VideoView - Add use of a Timer to delay stopping the display link - Change MPVController to ensure display link is running while seeking - Change PlayerCore to ensure display link is running while stepping - Change MainWindowController to ensure display link is running when entering and leaving full screen mode Rebased with develop and corrected merge conflicts.
Rebased with develop and corrected merge conflicts. |
// When playback is paused the display link is stopped in order to avoid wasting energy on | ||
// It must be running when stepping to avoid slowdowns caused by mpv waiting for IINA to call | ||
// mpv_render_report_swap. | ||
mainWindow.videoView.displayActive() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems even if the display link is not running, frame step commands can run correctly. Do we have to activate the display link manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stepping, seeking, all currently work because mpv will timeout and continue on. When that happens mpv will complain:
[ 14.169][v][vo/libmpv] mpv_render_report_swap() not being called.
We can tolerate some of this happening, but IINA should always try and avoid it. We don't want to see lots of these warnings from mpv when IINA is working correctly. For one thing that could hide other problems that trigger this warning that should not be occurring.
Because mpv does not give us an event to key off of (at least not that I could find) we have to tolerate this situation if the user sends a step command behind the back of IINA directly to mpv using the IPC interface. Unfortunate, but I don't see a way to deal with that situation.
This commit will: - Add methods displayActive and displayIdle to VideoView - Add use of a Timer to delay stopping the display link - Change MPVController to ensure display link is running while seeking - Change PlayerCore to ensure display link is running while stepping - Change MainWindowController to ensure display link is running when entering and leaving full screen mode Rebased with develop and corrected merge conflicts. Corrected PlayerCore.frameStep as per review comment.
Very good fix! Looks like it has secondary improvements too like snappier & more reliable OSD updating. |
This commit will:
Add methods displayActive and displayIdle to VideoView
Add use of a Timer to delay stopping the display link
Change MPVController to ensure display link is running while seeking
Change PlayerCore to ensure display link is running while stepping
Change MainWindowController to ensure display link is running when entering and leaving full screen mode
I have read CONTRIBUTING.md
This implements/fixes issue Lag when scrolling horizontally to seek in build 1.3.0 and 1.3.1 #4153.
Description: