]> git.sesse.net Git - vlc/blobdiff - modules/control/dbus.c
Use pl_Locked and pl_Unlocked
[vlc] / modules / control / dbus.c
index c8075a1f12a9bdd2db16507a813727ac27640bae..abb58fa9a4586f5c533b1ed45bce47ce08145e69 100644 (file)
@@ -47,7 +47,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
 #include <vlc_interface.h>
@@ -57,6 +57,8 @@
 
 #include <math.h>
 
+#include <assert.h>
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
@@ -106,10 +108,10 @@ struct intf_sys_t
  *****************************************************************************/
 
 vlc_module_begin();
-    set_shortname( _("dbus"));
+    set_shortname( N_("dbus"));
     set_category( CAT_INTERFACE );
     set_subcategory( SUBCAT_INTERFACE_CONTROL );
-    set_description( _("D-Bus control interface") );
+    set_description( N_("D-Bus control interface") );
     set_capability( "interface", 0 );
     set_callbacks( Open, Close );
 vlc_module_end();
@@ -382,6 +384,7 @@ DBUS_METHOD( Identity )
 DBUS_METHOD( AddTrack )
 { /* add the string to the playlist, and play it if the boolean is true */
     REPLY_INIT;
+    OUT_ARGUMENTS;
 
     DBusError error;
     dbus_error_init( &error );
@@ -409,6 +412,9 @@ DBUS_METHOD( AddTrack )
             PLAYLIST_END, true, false );
     pl_Release( p_playlist );
 
+    dbus_int32_t i_success = 0;
+    ADD_INT32( &i_success );
+
     REPLY_SEND;
 }
 
@@ -501,7 +507,7 @@ DBUS_METHOD( DelTrack )
     {
         playlist_DeleteFromInput( p_playlist,
             p_playlist->current.p_elems[i_position]->p_input->i_id,
-            true );
+            pl_Locked );
     }
     PL_UNLOCK;
 
@@ -871,7 +877,7 @@ static int TrackListChangeEmit( vlc_object_t *p_this, const char *psz_var,
         playlist_t *p_playlist = (playlist_t*)p_this;
         playlist_add_t *p_add = newval.p_address;
         playlist_item_t *p_item;
-        p_item = playlist_ItemGetById( p_playlist, p_add->i_node, true );
+        p_item = playlist_ItemGetById( p_playlist, p_add->i_node, pl_Unlocked );
         assert( p_item );
         while( p_item->p_parent )
             p_item = p_item->p_parent;
@@ -943,7 +949,7 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var,
     }
 
     if( newval.i_int == PLAYING_S || newval.i_int == PAUSE_S ||
-        newval.i_int == END_S )
+        newval.i_int == STOP_S ||  newval.i_int == END_S )
     {
         StatusChangeSignal( p_sys->p_conn, (void*) p_intf );
     }