]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/voutgl.m
macosx: Don't output any error when sending the crash log worked.
[vlc] / modules / gui / macosx / voutgl.m
index cdda0298653e6ca5ea045f2e2108946e0bcfd065..4a542e6bc742827fe6d1dc320293e73da746d7d4 100644 (file)
@@ -103,7 +103,6 @@ static void aglUnlock ( vout_thread_t * p_vout );
 int OpenVideoGL  ( vlc_object_t * p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *) p_this;
-    vlc_value_t value_drawable;
 
     if( !CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ) )
     {
@@ -119,8 +118,9 @@ int OpenVideoGL  ( vlc_object_t * p_this )
     memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
 #ifndef __x86_64__
-    var_Get( p_vout->p_libvlc, "drawable-agl", &value_drawable );
-    if( value_drawable.i_int != 0 )
+    int i_drawable_agl;
+    i_drawable_agl = var_GetInteger( p_vout->p_libvlc, "drawable-agl" );
+    if( i_drawable_agl > 0 )
     {
         static const GLint ATTRIBUTES[] = {
             AGL_WINDOW,
@@ -208,28 +208,26 @@ void CloseVideoGL ( vlc_object_t * p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *) p_this;
 
-    msg_Dbg( p_this, "Closing" );
 
 #ifndef __x86_64__
     if( p_vout->p_sys->b_embedded )
     {
+        /* If the fullscreen window is still open, close it */
+        if( p_vout->b_fullscreen )
+        {
+            p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+            aglManage( p_vout );
+            var_SetBool( p_vout->p_parent, "fullscreen", false );
+        }
         if( p_vout->p_sys->agl_ctx )
         {
             aglEnd( p_vout );
             aglDestroyContext(p_vout->p_sys->agl_ctx);
         }
     }
-    else if(VLCIntf && vlc_object_alive (VLCIntf))
-    {
-        NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
-
-        /* Close the window */
-        [p_vout->p_sys->o_vout_view performSelectorOnMainThread:@selector(closeVout) withObject:NULL waitUntilDone:YES];
-
-        [o_pool release];
-    }
-#else
-       if(VLCIntf && vlc_object_alive (VLCIntf))
+    else
+#endif
+    if(VLCIntf && vlc_object_alive (VLCIntf))
     {
         NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
 
@@ -238,7 +236,6 @@ void CloseVideoGL ( vlc_object_t * p_this )
 
         [o_pool release];
     }
-#endif
     /* Clean up */
     free( p_vout->p_sys );
 }
@@ -357,7 +354,7 @@ static void Unlock( vout_thread_t * p_vout )
         p_vout->p_sys->s_frame.size =
             [p_vout->p_sys->o_vout_view frame].size;
         p_vout->p_sys->s_frame.origin =
-            [[p_vout->p_sys->o_vout_view getWindow ]frame].origin;
+            [[p_vout->p_sys->o_vout_view voutWindow]frame].origin;
         p_vout->p_sys->b_saved_frame = true;
     }
 
@@ -673,7 +670,7 @@ static int aglManage( vout_thread_t * p_vout )
             if( !p_vout->p_sys->theWindow )
             {
                 /* Create a window */
-                WindowAttributes    windowAttrs;
+                WindowAttributes windowAttrs;
 
                 windowAttrs = kWindowStandardDocumentAttributes
                             | kWindowStandardHandlerAttribute