aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-07-02 13:17:20 +0200
committerGravatar wm4 <wm4@nowhere>2015-07-02 13:18:06 +0200
commitff25c0ad7d7c3d1ca6f147a689884afc24e4b250 (patch)
treea6ad552d878420e5d79f7a1ad9dfaac10651dac2 /video
parent53845d81f5f8933b92a1d03bae91e94c5106334b (diff)
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 2133d26357..273a312b06 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -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