1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

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.)
This commit is contained in:
wm4 2015-07-15 14:58:56 +02:00
parent 7ef8f457a8
commit 15954c36ca

View File

@ -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) {