diff options
author | wm4 <wm4@nowhere> | 2017-08-29 15:15:34 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-29 15:15:34 +0200 |
commit | a9571fcc0f3d8c3f9033170660dc3b39103b2867 (patch) | |
tree | 2e054cd1ac38800927c09440b3451ede6b0d0fe8 /video/out | |
parent | a46500a2c820222c0aaa4c4c384d4d7df9eb8414 (diff) | |
download | mpv-a9571fcc0f3d8c3f9033170660dc3b39103b2867.tar.bz2 mpv-a9571fcc0f3d8c3f9033170660dc3b39103b2867.tar.xz |
vo_opengl: don't discard buffered video on redundant resize calls
If a VO-area option changes, gl_video_resize() is called
unconditionally. This function does something even if the size does not
change (at least it discards buffered frames for interpolation), which
can lead to stutter when you keep firing option change events during
playback.
Check for an actual resize, and if nothing changes, exit early.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/video.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index f95222081c..53f6b8a21c 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -3133,6 +3133,11 @@ void gl_video_resize(struct gl_video *p, struct mp_rect *src, struct mp_rect *dst, struct mp_osd_res *osd) { + if (mp_rect_equals(&p->src_rect, src) && + mp_rect_equals(&p->dst_rect, dst) && + osd_res_equals(p->osd_rect, *osd)) + return; + p->src_rect = *src; p->dst_rect = *dst; p->osd_rect = *osd; |