+ int i_ret, i_fullscreen_change;
+
+ i_fullscreen_change = ( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE );
+
+ p_vout->fmt_out.i_x_offset = p_sys->p_vout->fmt_in.i_x_offset =
+ p_vout->fmt_in.i_x_offset;
+ p_vout->fmt_out.i_y_offset = p_sys->p_vout->fmt_in.i_y_offset =
+ p_vout->fmt_in.i_y_offset;
+ p_vout->fmt_out.i_visible_width = p_sys->p_vout->fmt_in.i_visible_width =
+ p_vout->fmt_in.i_visible_width;
+ p_vout->fmt_out.i_visible_height = p_sys->p_vout->fmt_in.i_visible_height =
+ p_vout->fmt_in.i_visible_height;
+ p_vout->fmt_out.i_aspect = p_sys->p_vout->fmt_in.i_aspect =
+ p_vout->fmt_in.i_aspect;
+ p_vout->fmt_out.i_sar_num = p_sys->p_vout->fmt_in.i_sar_num =
+ p_vout->fmt_in.i_sar_num;
+ p_vout->fmt_out.i_sar_den = p_sys->p_vout->fmt_in.i_sar_den =
+ p_vout->fmt_in.i_sar_den;
+ p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
+
+ p_sys->p_vout->i_changes = p_vout->i_changes;
+ i_ret = p_sys->p_vout->pf_manage( p_sys->p_vout );
+ p_vout->i_changes = p_sys->p_vout->i_changes;
+
+#ifdef __APPLE__
+ if( p_sys->p_vout->pf_lock &&
+ p_sys->p_vout->pf_lock( p_sys->p_vout ) )
+ {
+ msg_Warn( p_vout, "could not lock OpenGL provider" );
+ return i_ret;
+ }
+
+ /* On OS X, we create the window and the GL view when entering
+ fullscreen - the textures have to be inited again */
+ if( i_fullscreen_change )
+ {
+ InitTextures( p_vout );
+
+ switch( p_sys->i_effect )
+ {
+ case OPENGL_EFFECT_CUBE:
+ glEnable( GL_CULL_FACE );
+ break;
+
+ case OPENGL_EFFECT_TRANSPARENT_CUBE:
+ glDisable( GL_DEPTH_TEST );
+ glEnable( GL_BLEND );
+ glBlendFunc( GL_SRC_ALPHA, GL_ONE );
+ break;
+ }
+
+ if( p_sys->i_effect & ( OPENGL_EFFECT_CUBE |
+ OPENGL_EFFECT_TRANSPARENT_CUBE ) )
+ {
+ /* Set the perpective */
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glFrustum( -1.0, 1.0, -1.0, 1.0, 3.0, 20.0 );
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glTranslatef( 0.0, 0.0, - 5.0 );
+ }
+ }
+
+ if( p_sys->p_vout->pf_unlock )
+ {
+ p_sys->p_vout->pf_unlock( p_sys->p_vout );
+ }
+#endif
+
+ return i_ret;