[vlc-commits] dbus: register object path before bus names

Rémi Denis-Courmont git at videolan.org
Sat Aug 16 12:50:02 CEST 2014


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 16 13:37:23 2014 +0300| [37232b5eac0ae3441d64a1f6f51d5fa21ee453f1] | committer: Rémi Denis-Courmont

dbus: register object path before bus names

This fixes a race condition where the player was visible on the bus
with the MPRIS name, but did not implement MPRIS.

(cherry picked from commit d32c36dc11322402e47838d8ed2d69b8e47a2e55)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=37232b5eac0ae3441d64a1f6f51d5fa21ee453f1
---

 modules/control/dbus/dbus.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index bbf7f7b..8fdcb20 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -198,6 +198,10 @@ static int Open( vlc_object_t *p_this )
 
     dbus_connection_set_exit_on_disconnect( p_conn, FALSE );
 
+    /* Register the entry point object path */
+    dbus_connection_register_object_path( p_conn, DBUS_MPRIS_OBJECT_PATH,
+            &dbus_mpris_vtable, p_this );
+
     /* register an instance-specific well known name of the form
      * org.mpris.MediaPlayer2.vlc.instanceXXXX where XXXX is the
      * current process's pid */
@@ -226,10 +230,6 @@ static int Open( vlc_object_t *p_this )
      * the only VLC instance currently connected to the bus */
     dbus_bus_request_name( p_conn, DBUS_MPRIS_BUS_NAME, 0, NULL );
 
-    /* Register the entry point object path */
-    dbus_connection_register_object_path( p_conn, DBUS_MPRIS_OBJECT_PATH,
-            &dbus_mpris_vtable, p_this );
-
     dbus_connection_flush( p_conn );
 
     p_intf->p_sys = p_sys;



More information about the vlc-commits mailing list