]> git.sesse.net Git - vlc/commitdiff
macosx: cleanup
authorJean-Paul Saman <jpsaman@videolan.org>
Tue, 10 Mar 2009 09:51:36 +0000 (10:51 +0100)
committerJean-Paul Saman <jpsaman@videolan.org>
Mon, 16 Mar 2009 11:06:28 +0000 (12:06 +0100)
modules/gui/macosx/intf.m
modules/gui/macosx/playlistinfo.m

index 854712158241794f0fc5377cd580c619205ff3b4..318b94f1346966a9dd33df26ce9c41c85e357a11 100644 (file)
@@ -79,9 +79,7 @@ int OpenIntf ( vlc_object_t *p_this )
 
     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )
-    {
-        return( 1 );
-    }
+        return VLC_ENOMEM;
 
     memset( p_intf->p_sys, 0, sizeof( *p_intf->p_sys ) );
 
@@ -92,7 +90,7 @@ int OpenIntf ( vlc_object_t *p_this )
     p_intf->pf_run = Run;
     p_intf->b_should_run_on_first_thread = true;
 
-    return( 0 );
+    return VLC_SUCCESS;
 }
 
 /*****************************************************************************
@@ -184,10 +182,13 @@ static int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
                      vlc_value_t old_val, vlc_value_t new_val, void *param )
 {
     intf_thread_t * p_intf = VLCIntf;
-    p_intf->p_sys->b_intf_update = true;
-    p_intf->p_sys->b_playlist_update = true;
-    p_intf->p_sys->b_playmode_update = true;
-    p_intf->p_sys->b_current_title_update = true;
+    if( p_intf && p_intf->p_sys )
+    {
+        p_intf->p_sys->b_intf_update = true;
+        p_intf->p_sys->b_playlist_update = true;
+        p_intf->p_sys->b_playmode_update = true;
+        p_intf->p_sys->b_current_title_update = true;
+    }
     return VLC_SUCCESS;
 }
 
@@ -200,7 +201,8 @@ static int ShowController( vlc_object_t *p_this, const char *psz_variable,
                      vlc_value_t old_val, vlc_value_t new_val, void *param )
 {
     intf_thread_t * p_intf = VLCIntf;
-    p_intf->p_sys->b_intf_show = true;
+    if( p_intf && p_intf->p_sys )
+        p_intf->p_sys->b_intf_show = true;
     return VLC_SUCCESS;
 }
 
@@ -212,7 +214,8 @@ static int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable,
                      vlc_value_t old_val, vlc_value_t new_val, void *param )
 {
     intf_thread_t * p_intf = VLCIntf;
-    p_intf->p_sys->b_fullscreen_update = true;
+    if( p_intf && p_intf->p_sys )
+        p_intf->p_sys->b_fullscreen_update = true;
     return VLC_SUCCESS;
 }
 
@@ -1538,7 +1541,8 @@ static void * manage_cleanup( void * args )
         bool b_chapters = false;
 
         playlist_t * p_playlist = pl_Hold( p_intf );
-    /* TODO: fix i_size use */
+
+        /* TODO: fix i_size use */
         b_plmul = p_playlist->items.i_size > 1;
 
         p_input = playlist_CurrentInput( p_playlist );
index d924cfc37dfd0119a0e128d0669c4123abfdba6e..b5615e0f792c6723520c00061968faba85df246c 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  r playlistinfo.m: MacOS X interface module
  *****************************************************************************
- * Copyright (C) 2002-2008 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Benjamin Pracht <bigben at videolan dot org>
@@ -45,9 +45,12 @@ static VLCInfo *_o_sharedInstance = nil;
 
 - (id)init
 {
-    if( _o_sharedInstance ) {
+    if( _o_sharedInstance )
+    {
         [self dealloc];
-    } else {
+    }
+    else
+    {
         _o_sharedInstance = [super init];
         
         if( _o_sharedInstance != nil )
@@ -302,7 +305,6 @@ static VLCInfo *_o_sharedInstance = nil;
 
     /* update the stats once to display p_item change faster */
     [self updateStatistics: nil];
-
 }
 
 - (void)setMeta: (char *)psz_meta forLabel: (id)theItem
@@ -484,7 +486,6 @@ error:
     }
 }
 
-
 @end
 
 @implementation VLCInfoTreeItem