[vlc-commits] opengl: forward the error code from the resize callback
Steve Lhomme
git at videolan.org
Wed Jan 16 11:06:53 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 16 10:57:55 2019 +0100| [a28dc3049d06a444d73dd2407efcf4fcff878524] | committer: Steve Lhomme
opengl: forward the error code from the resize callback
And return an error in VOUT_DISPLAY_CHANGE_DISPLAY_SIZE if resizing fails.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a28dc3049d06a444d73dd2407efcf4fcff878524
---
include/vlc_opengl.h | 5 +++--
modules/video_output/opengl/display.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h
index 25e28934fa..a2e838b699 100644
--- a/include/vlc_opengl.h
+++ b/include/vlc_opengl.h
@@ -96,10 +96,11 @@ static inline void vlc_gl_ReleaseCurrent(vlc_gl_t *gl)
gl->releaseCurrent(gl);
}
-static inline void vlc_gl_Resize(vlc_gl_t *gl, unsigned w, unsigned h)
+static inline int vlc_gl_Resize(vlc_gl_t *gl, unsigned w, unsigned h)
{
if (gl->resize != NULL)
- gl->resize(gl, w, h);
+ return gl->resize(gl, w, h);
+ return VLC_SUCCESS;
}
static inline void vlc_gl_Swap(vlc_gl_t *gl)
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index 087e288034..14559110dc 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -243,7 +243,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
c.align.vertical = VLC_VIDEO_ALIGN_TOP;
vout_display_PlacePicture(&place, src, &c);
- vlc_gl_Resize (sys->gl, c.display.width, c.display.height);
+ if (vlc_gl_Resize (sys->gl, c.display.width, c.display.height) != VLC_SUCCESS)
+ return VLC_EGENERIC;
if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
return VLC_EGENERIC;
vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);
More information about the vlc-commits
mailing list