[vlc-commits] vout ios: lock the OpenGL context before applying changes
Carola Nitz
git at videolan.org
Thu Sep 7 20:04:35 CEST 2017
vlc | branch: master | Carola Nitz <nitz.carola at googlemail.com> | Thu Sep 7 19:46:56 2017 +0200| [de872e1d741c05ec0f505cc3c47c36e5457b4c98] | committer: Felix Paul Kühne
vout ios: lock the OpenGL context before applying changes
Signed-off-by: Felix Paul Kühne <felix at serioese.gmbh>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de872e1d741c05ec0f505cc3c47c36e5457b4c98
---
modules/video_output/ios.m | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 9e59212a1e..3cf59f5094 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -321,20 +321,28 @@ static int Control(vout_display_t *vd, int query, va_list ap)
sys->place = place;
}
- if (sys->gl != NULL)
+ if (sys->gl != NULL) {
+ vlc_gl_MakeCurrent(sys->gl);
vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);
+ }
// x / y are top left corner, but we need the lower left one
- if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
+ if (query != VOUT_DISPLAY_CHANGE_DISPLAY_SIZE) {
glViewport(place.x, cfg_tmp.display.height - (place.y + place.height), place.width, place.height);
+ vlc_gl_ReleaseCurrent(sys->gl);
+ }
}
return VLC_SUCCESS;
}
case VOUT_DISPLAY_CHANGE_VIEWPOINT:
- if (sys->gl != NULL)
- return vout_display_opengl_SetViewpoint(sys->vgl,
+ if (sys->gl != NULL) {
+ vlc_gl_MakeCurrent(sys->gl);
+ int viewport = vout_display_opengl_SetViewpoint(sys->vgl,
&va_arg (ap, const vout_display_cfg_t* )->viewpoint);
+ vlc_gl_ReleaseCurrent(sys->gl);
+ return viewport;
+ }
else
return VLC_EGENERIC;
More information about the vlc-commits
mailing list