summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-13 21:49:07 -0500
committerNiklas Haas <github-daiK1o@haasn.dev>2023-08-16 14:13:43 +0200
commit640c07fb19b7ea11f1a97784e517c38449f816d0 (patch)
treebd07936ab6f92977e04f98fda4690d5d5ec48b20 /video
parent455487bdc908f7add2163e354b5ac68a33f499b9 (diff)
downloadmpv-640c07fb19b7ea11f1a97784e517c38449f816d0.tar.bz2
mpv-640c07fb19b7ea11f1a97784e517c38449f816d0.tar.xz
vo: clear vsync_offset if drawing while paused
libplacebo doesn't like it when the queue_params PTS is less than the actual PTS of the frame for the first frame and skips mixing it during interpolation. This can happen if you seek while paused because mpv will always keep the vsync_offset value as if it was still playing. So in some cases, this can be a negative value and thus the PTS will end up decreasing and libplacebo interprets this frame as a first frame. This skips mixing the frame and thus you get a black screen. To fix this this, just realize that vsync timings are completely meaninglessly in while paused. If you are not actively pushing frames, there's no reason to care about vsync_offset. So just clear it and make it zero when the VO's internal state is paused and we're trying to render a frame. Makes libplacebo happy and fixes #11958.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index c53cec36a1..4b05e6042e 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -907,6 +907,9 @@ static bool render_frame(struct vo *vo)
frame->duration = -1;
}
+ if (in->paused)
+ frame->vsync_offset = 0;
+
int64_t now = mp_time_us();
int64_t pts = frame->pts;
int64_t duration = frame->duration;