[vlc-commits] glwin32: handle display area changes only when they change
Steve Lhomme
git at videolan.org
Tue Aug 25 15:33:20 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Aug 25 12:11:04 2020 +0200| [fc5902f24d82faba04b9ab4fef2f85d698bf4af2] | committer: Steve Lhomme
glwin32: handle display area changes only when they change
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc5902f24d82faba04b9ab4fef2f85d698bf4af2
---
modules/video_output/win32/glwin32.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 6a0f7468e7..4ccfd3dae8 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -207,13 +207,17 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
VLC_UNUSED(date);
vout_display_sys_t *sys = vd->sys;
- const int width = sys->area.place.width;
- const int height = sys->area.place.height;
- vlc_gl_Resize (sys->gl, width, height);
if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
return;
- vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)width / height);
- vout_display_opengl_Viewport(sys->vgl, sys->area.place.x, sys->area.place.y, width, height);
+ if (sys->area.place_changed)
+ {
+ const int width = sys->area.place.width;
+ const int height = sys->area.place.height;
+ vlc_gl_Resize (sys->gl, width, height);
+ vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)width / height);
+ vout_display_opengl_Viewport(sys->vgl, sys->area.place.x, sys->area.place.y, width, height);
+ sys->area.place_changed = false;
+ }
vout_display_opengl_Prepare (sys->vgl, picture, subpicture);
vlc_gl_ReleaseCurrent (sys->gl);
}
More information about the vlc-commits
mailing list