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.
This commit is contained in:
Dudemanguy 2023-08-13 21:49:07 -05:00 committed by Niklas Haas
parent 455487bdc9
commit 640c07fb19
1 changed files with 3 additions and 0 deletions

View File

@ -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;