vo_opengl: fix "freezes" after seeking with interpolation on

When seeking to a different position, and seeking takes long, the OSD
might get redrawn. This means that the VO will receive a request to
redraw an old frame using whatever the previous PTS was. This breaks the
interpolation logic: the old frame will be added to the queue, and then
the next frames (with lower PTS if you seeked backwards) are not drawn
as the logic assumes they're past frames.

Fix this by using the non-interpolation code path when redrawing after a
seek reset, and no "real" frame has been drawn yet.

It's a recent regression caused by the redrawing code simplification.
The old code simply sent a VOCTRL for redrawing the frame, and the VO
had to deal with retaining the old frame on its own.

This is a hack as in there's probably a better solution.

Fixes #2097.
This commit is contained in:
wm4 2015-07-02 13:17:20 +02:00
parent 53845d81f5
commit ff25c0ad7d
1 changed files with 5 additions and 1 deletions

View File

@ -194,6 +194,7 @@ struct gl_video {
int surface_idx;
int surface_now;
int frames_drawn;
bool is_interpolated;
// state for luma (0), luma-down(1), chroma (2) and temporal (3) scalers
@ -527,6 +528,7 @@ static void gl_video_reset_surfaces(struct gl_video *p)
}
p->surface_idx = 0;
p->surface_now = 0;
p->frames_drawn = 0;
}
static inline int fbosurface_wrap(int id)
@ -2206,6 +2208,8 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t,
p->is_interpolated = true;
}
pass_draw_to_screen(p, fbo);
p->frames_drawn += 1;
}
// (fbo==0 makes BindFramebuffer select the screen backbuffer)
@ -2229,7 +2233,7 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
if (has_frame) {
gl_sc_set_vao(p->sc, &p->vao);
if (p->opts.interpolation) {
if (p->opts.interpolation && (p->frames_drawn || !frame->still)) {
gl_video_interpolate_frame(p, frame, fbo);
} else {
// Skip interpolation if there's nothing to be done