From 15954c36cac025bf64425b57cddb106c5c00c062 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 15 Jul 2015 14:58:56 +0200 Subject: vo_opengl: reject future images in different formats The VO will be provided with future frames even if the format changes mid-stream. This caused a crash if these frames were actually used (i.e. interpolation mode was enabled). Fixes a crash when deinterlacing is toggled during playback, and the deinterlacer changes the stream format (as it can happen e.g. if the decoder outputs nv12, which in turn happens with hw decoding). (On a side note, future frames are always non-NULL. Also, the current frame is of course always in the correct format.) --- video/out/gl_video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index e1d9c0e7a1..1b4ddd0490 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -2131,7 +2131,8 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t, break; struct mp_image *f = t->frames[i]; - if (!f || f->pts == MP_NOPTS_VALUE) + if (!mp_image_params_equal(&f->params, &p->real_image_params) || + f->pts == MP_NOPTS_VALUE) continue; if (f->pts > p->surfaces[p->surface_idx].pts) { -- cgit v1.2.3