]> git.sesse.net Git - vlc/blobdiff - modules/gui/pda/pda_callbacks.c
Use pl_Locked and pl_Unlocked
[vlc] / modules / gui / pda / pda_callbacks.c
index 1685c58411ebf85fc28227ceed075673f88a919f..b0cc1d1f92cefcd3fc7afa08353e4a7f881ac86f 100644 (file)
@@ -30,7 +30,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_input.h>
 #include <vlc_interface.h>
 #include <vlc_playlist.h>
@@ -56,7 +56,7 @@ static char *get_file_perms(struct stat st);
 /*****************************************************************************
  * Useful function to retrieve p_intf
  ****************************************************************************/
-void * E_(__GtkGetIntf)( GtkWidget * widget )
+void * __GtkGetIntf( GtkWidget * widget )
 {
     void *p_data;
 
@@ -120,7 +120,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options,
             gtk_list_store_set (GTK_LIST_STORE(p_play_model), &p_play_iter,
                                     0, name,   /* Add path to it !!! */
                                     1, "no info",
-                                    2, playlist_CurrentSize(p_intf), /* Hidden index. */
+                                    2, playlist_CurrentSize(p_playlist), /* Hidden index. */
                                     -1 );
 
             /* Add to VLC's playlist */
@@ -138,7 +138,7 @@ static void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options,
                               PLAYLIST_APPEND, PLAYLIST_END,
                               (mtime_t) 0,
                               (const char **) ppsz_options, i_pos,
-                              VLC_TRUE, VLC_FALSE );
+                              true, pl_Unlocked );
             }
 
             /* Cleanup memory */
@@ -162,10 +162,10 @@ void PlaylistRebuildListStore( intf_thread_t *p_intf,
     red.blue    = 0;
     red.green   = 0;
 #endif
-    vlc_mutex_lock( &p_playlist->object_lock );
-    for( i_dummy = 0; i_dummy < playlist_CurrentSize(p_intf) ; i_dummy++ )
+    vlc_object_lock( p_playlist );
+    for( i_dummy = 0; i_dummy < playlist_CurrentSize(p_playlist) ; i_dummy++ )
     {
-        playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_dummy, VLC_TRUE );
+        playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_dummy, pl_Locked );
         if( p_item )
         {
             ppsz_text[0] = p_item->p_input->psz_name;
@@ -178,7 +178,7 @@ void PlaylistRebuildListStore( intf_thread_t *p_intf,
                                 -1);
         }
     }
-    vlc_mutex_unlock( &p_playlist->object_lock );
+    vlc_object_unlock( p_playlist );
 }
 
 /*****************************************************************
@@ -231,7 +231,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
                                 4, ppsz_text[3],
                                 -1);
 
-            if (ppsz_text[1]) free(ppsz_text[1]);
+            free(ppsz_text[1]);
         }
             /* kludge */
         for (i=0; i<n; i++)
@@ -260,7 +260,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
                                     4, ppsz_text[3],
                                     -1);
 
-                if (ppsz_text[1]) free(ppsz_text[1]);
+                free(ppsz_text[1]);
             }
         }
         free(pp_namelist);
@@ -383,16 +383,16 @@ void onPlay(GtkButton *button, gpointer user_data)
 
     if (p_playlist)
     {
-        vlc_mutex_lock( &p_playlist->object_lock );
-        if (playlist_CurrentSize(p_intf))
+        vlc_object_lock( p_playlist );
+        if (playlist_CurrentSize(p_playlist))
         {
-            vlc_mutex_unlock( &p_playlist->object_lock );
+            vlc_object_unlock( p_playlist );
             playlist_Play( p_playlist );
             gdk_window_lower( p_intf->p_sys->p_window->window );
         }
         else
         {
-            vlc_mutex_unlock( &p_playlist->object_lock );
+            vlc_object_unlock( p_playlist );
         }
         vlc_object_release( p_playlist );
     }
@@ -929,7 +929,7 @@ void onClearPlaylist(GtkButton *button, gpointer user_data)
         return;
     }
 
-    for(item = playlist_CurrentSize(p_intf) - 1; item >= 0 ;item-- )
+    for(item = playlist_CurrentSize(p_playlist) - 1; item >= 0 ;item-- )
     {
         msg_Err( p_playlist, "fix pda delete" );
     }