summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-15 14:58:56 +0200
committerwm4 <wm4@nowhere>2015-07-15 14:59:26 +0200
commit15954c36cac025bf64425b57cddb106c5c00c062 (patch)
tree30c4b718bc6c7f1dcacbd4b2a884df105734e669
parent7ef8f457a8631ff09a928ee5aa6bb3f5fabfce11 (diff)
downloadmpv-15954c36cac025bf64425b57cddb106c5c00c062.tar.bz2
mpv-15954c36cac025bf64425b57cddb106c5c00c062.tar.xz
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.)
-rw-r--r--video/out/gl_video.c3
1 files changed, 2 insertions, 1 deletions
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) {