]> git.sesse.net Git - vlc/blobdiff - modules/gui/pda/pda.c
pda gui: Set prio to 0, so it is not eligible for automatic selection. This is bad...
[vlc] / modules / gui / pda / pda.c
index 269675656e465bb9318e16b54b6f81ed108ee2d5..15719707632955b6c90b5457560578033c0bd00c 100644 (file)
@@ -31,7 +31,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_interface.h>
@@ -71,7 +71,7 @@ vlc_module_begin();
     set_category( CAT_INTERFACE );
     set_subcategory( SUBCAT_INTERFACE_MAIN );
 //    add_bool( "pda-autoplayfile", 1, GtkAutoPlayFile, AUTOPLAYFILE_TEXT, AUTOPLAYFILE_LONGTEXT, true );
-    set_capability( "interface", 70 );
+    set_capability( "interface", 0 );
     set_callbacks( Open, Close );
     add_shortcut( "pda" );
 vlc_module_end();
@@ -288,7 +288,7 @@ static void Run( intf_thread_t *p_intf )
     gtk_tree_view_column_set_sort_column_id(p_column, 2);
 #endif
     /* update the playlist */
-    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    p_playlist = pl_Yield( p_intf );
     p_playlist_store = gtk_list_store_new (3,
                 G_TYPE_STRING, /* Filename */
                 G_TYPE_STRING, /* Time */
@@ -296,7 +296,7 @@ static void Run( intf_thread_t *p_intf )
     PlaylistRebuildListStore(p_intf,p_playlist_store, p_playlist);
     gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_playlist_store));
     g_object_unref(p_playlist_store);
-    vlc_object_release(p_playlist); /* Free the playlist */
+    pl_Release( p_intf ); /* Free the playlist */
     gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
 
     /* Column properties */
@@ -417,8 +417,8 @@ static int Manage( intf_thread_t *p_intf )
         input_thread_t *p_input = p_intf->p_sys->p_input;
         int64_t i_time = 0, i_length = 0;
 
-        vlc_mutex_lock( &p_input->object_lock );
-        if( !p_input->b_die )
+        vlc_object_lock( p_input );
+        if( vlc_object_alive (p_input) )
         {
             playlist_t *p_playlist;
 
@@ -426,8 +426,7 @@ static int Manage( intf_thread_t *p_intf )
             p_intf->p_sys->b_playing = 1;
 
             /* update playlist interface */
-            p_playlist = (playlist_t *) vlc_object_find(
-                    p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+            p_playlist = pl_Yield( p_intf );
             if (p_playlist != NULL)
             {
                 p_liststore = gtk_list_store_new (3,
@@ -437,7 +436,7 @@ static int Manage( intf_thread_t *p_intf )
                 PlaylistRebuildListStore(p_intf, p_liststore, p_playlist);
                 gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
                 g_object_unref(p_liststore);
-                vlc_object_release( p_playlist );
+                pl_Release( p_intf );
             }
 
             /* Manage the slider */
@@ -469,9 +468,9 @@ static int Manage( intf_thread_t *p_intf )
                         double f_pos = (double)newvalue / 100.0;
 
                         /* release the lock to be able to seek */
-                        vlc_mutex_unlock( &p_input->object_lock );
+                        vlc_object_unlock( p_input );
                         var_SetFloat( p_input, "position", f_pos );
-                        vlc_mutex_lock( &p_input->object_lock );
+                        vlc_object_lock( p_input );
 
                         /* Update the old value */
                         p_intf->p_sys->f_adj_oldvalue = newvalue;
@@ -503,9 +502,9 @@ static int Manage( intf_thread_t *p_intf )
                         double f_pos = (double)newvalue / 100.0;
 
                         /* release the lock to be able to seek */
-                        vlc_mutex_unlock( &p_input->object_lock );
+                        vlc_object_unlock( p_input );
                         var_SetFloat( p_input, "position", f_pos );
-                        vlc_mutex_lock( &p_input->object_lock );
+                        vlc_object_lock( p_input );
 
                         /* Update the old value */
                         p_intf->p_sys->i_adj_oldvalue = newvalue;
@@ -513,7 +512,7 @@ static int Manage( intf_thread_t *p_intf )
                 }
             }
         }
-        vlc_mutex_unlock( &p_input->object_lock );
+        vlc_object_unlock( p_input );
     }
     else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) )
     {