]> git.sesse.net Git - vlc/commitdiff
dbus control: AFAIK we must lock here.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 14 Jan 2010 13:10:15 +0000 (14:10 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 14 Jan 2010 13:10:15 +0000 (14:10 +0100)
modules/control/dbus.c

index ed8f88cd3f3909f8719934e359dd7abffe977f9b..5a4018e289ca9daf2fc476420e1b4912d8f74797 100644 (file)
@@ -419,8 +419,11 @@ DBUS_METHOD( GetCurrentTrack )
     REPLY_INIT;
     OUT_ARGUMENTS;
 
-    /* XXX: how about locking?! */
+    playlist_t *p_playlist = PL;
+
+    PL_LOCK;
     dbus_int32_t i_position = PL->i_current_index;
+    PL_UNLOCK;
 
     ADD_INT32( &i_position );
     REPLY_SEND;
@@ -462,9 +465,11 @@ DBUS_METHOD( GetLength )
 {
     REPLY_INIT;
     OUT_ARGUMENTS;
+    playlist_t *p_playlist = PL;
 
-    /* XXX: how about locking */
+    PL_LOCK;
     dbus_int32_t i_elements = PL->current.i_size;
+    PL_UNLOCK;
 
     ADD_INT32( &i_elements );
     REPLY_SEND;