fix(mpv): avoid render stalls from video timing offset (#6)
mpvqt renders without disabling MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME, so each new video frame blocks the Qt Quick render thread for up to video-timing-offset (50 ms). Animations over a playing video (playlist slide-in) stuttered; paused video was smooth. Set video-timing-offset=0. Measured offscreen while toggling the playlist during playback: worst frame 35–39 ms before, 17–21 ms after. Reviewed-on: #6 Co-authored-by: Tri Vo Khac <git@trivk.dev>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
41188fc665
commit
32c686e0e3
1 file changed
+4
@@ -33,6 +33,10 @@ MpvItem::MpvItem(QQuickItem *parent)
|
||||
// Leave the player on the last frame at end of file instead of unloading it.
|
||||
setPropertyAsync(QStringLiteral("keep-open"), QStringLiteral("yes"));
|
||||
setPropertyAsync(QStringLiteral("hwdec"), QStringLiteral("auto-safe"));
|
||||
// mpvqt renders with the default blocking timing, so each new video frame stalls
|
||||
// the Qt Quick render thread for up to this offset (50 ms) and animations drawn
|
||||
// over a playing video stutter. Hand frames over at their display time instead.
|
||||
setPropertyAsync(QStringLiteral("video-timing-offset"), 0);
|
||||
// Also pick up "movie.en.srt" style files next to "movie.mkv".
|
||||
setPropertyAsync(QStringLiteral("sub-auto"), QStringLiteral("fuzzy"));
|
||||
|
||||
|
||||
Reference in new issue
Block a user