mpv: Prevent blocking in the render update callback for vo=libmpv
According to the documentation, setting video-timing-offset to 0 prevents blocking during render updates. This has a noticeable effect on improving the software frame rate on wayland.
I'm not sure this should be the default. Wouldn't it make frame timings worse in some cases?
I'm not sure this should be the default. Wouldn't it make frame timings worse in some cases?
By default, the render update callback blocks the UI thread for 0.05 seconds during rendering. We really shouldn’t be blocking the UI thread like that.
It works fine on my machine and even helps reduce frame drops. But you’re right, it probably does need more testing.
Tested on a laptop with 240Hz screen. Celluloid went from under 60 FPS to 230-240 FPS.
After some more testing, I noticed that these options cause a small amount of AV desync (around 0.0002s). From my reading of the documentation, I think we're supposed to time the call mpv_render_context_render() ourselves to eliminate the desync. Once that's done, it should be okay to merge this.