]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/vout.m
* remove commented ifs o_O
[vlc] / modules / gui / macosx / vout.m
index c009513102e206fd2799b839adb8609906ac2ad0..62a8a6f759f1be186210cbac9cc3ee63f13cc807 100644 (file)
@@ -97,7 +97,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     }
     else
     {
-        msg_Warn( VLCIntf, "Cannot find Video Output");
+        msg_Warn( VLCIntf, "cannot find Video Output");
     }
 }
 
@@ -111,10 +111,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
 - (BOOL)windowContainsEmbedded: (id)o_window
 {
-    if( ![[o_window className] isEqualToString: @"VLCWindow"] )
+/*    if( ![[o_window className] isEqualToString: @"VLCWindow"] )
     {
         NSLog( @"We were not given a VLCWindow" );
-    }
+    }*/
     return ([self getViewForWindow: o_window] == nil ? NO : YES );
 }
 
@@ -935,9 +935,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     b_init_ok = VLC_FALSE;
 
     p_fullscreen_state = NULL;
-    b_fullscreen = VLC_FALSE;
     p_real_vout = [VLCVoutView getRealVout: p_vout];
     i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" );
+    b_black = var_GetBool( p_real_vout->p_vlc, "macosx-black" );
 
     /* Find out on which screen to open the window */
     if( i_device <= 0 || i_device > (int)[o_screens count] )
@@ -958,7 +958,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     if( p_vout->b_fullscreen )
     {
         CGDisplayFadeReservationToken token;
-        b_fullscreen = VLC_TRUE;
         NSRect screen_rect = [o_screen frame];
         screen_rect.origin.x = screen_rect.origin.y = 0;
 
@@ -968,12 +967,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
               backing: NSBackingStoreBuffered
               defer: YES screen: o_screen];
 
-        if( var_GetBool( p_vout, "macosx-black" ) )
+        if( var_GetBool( p_real_vout, "macosx-black" ) )
+        if( b_black == VLC_TRUE )
         {
             CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
             CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, true );
             CGReleaseDisplayFadeReservation( token );
-            int i;
+            unsigned int i;
             for( i = 0 ; i < [o_screens count]; i++)
             {
                 struct
@@ -986,7 +986,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
                 CGDisplayCount dspyCnt;
                 CGPoint gPoint;
 
-                if( i == i_device ) continue;
+                if( i == (unsigned int)i_device ) continue;
 
                 screen_rect = [[o_screens objectAtIndex: i] frame];
 
@@ -1010,10 +1010,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
             BeginFullScreen( &p_fullscreen_state, NULL, 0, 0,
                              NULL, NULL, fullScreenAllowEvents );
         }
-        if( var_GetBool( p_vout, "macosx-black" ) )
+        if( b_black == VLC_TRUE )
         {
             CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
-            CGDisplayFade( token, 2, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false );
+            CGDisplayFade( token, 2 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false );
             CGReleaseDisplayFadeReservation( token);
         }
     }
@@ -1097,18 +1097,15 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
 - (id) closeReal: (id) sender
 {
-    if( b_fullscreen == VLC_TRUE )
+    if( p_fullscreen_state )
+        EndFullScreen( p_fullscreen_state, 0 );
+    if( b_black == VLC_TRUE )
     {
-        if( p_vout->b_fullscreen )
-            EndFullScreen( p_fullscreen_state, 0 );
-        if( var_GetBool( p_vout, "macosx-black" ) )
-        {
-            CGDisplayFadeReservationToken token;
-            CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
-            CGDisplayFade( token, 2, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false );
-            CGReleaseDisplayFadeReservation( token);
-            CGDisplayRestoreColorSyncSettings();
-        }
+        CGDisplayFadeReservationToken token;
+        CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
+        CGDisplayFade( token, 2, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false );
+        CGReleaseDisplayFadeReservation( token);
+        CGDisplayRestoreColorSyncSettings();
     }
     [super close];
     return NULL;