Commit 37232b5e authored by Rémi Denis-Courmont's avatar 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)
parent 003586cc
...@@ -198,6 +198,10 @@ static int Open( vlc_object_t *p_this ) ...@@ -198,6 +198,10 @@ static int Open( vlc_object_t *p_this )
dbus_connection_set_exit_on_disconnect( p_conn, FALSE ); 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 /* register an instance-specific well known name of the form
* org.mpris.MediaPlayer2.vlc.instanceXXXX where XXXX is the * org.mpris.MediaPlayer2.vlc.instanceXXXX where XXXX is the
* current process's pid */ * current process's pid */
...@@ -226,10 +230,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -226,10 +230,6 @@ static int Open( vlc_object_t *p_this )
* the only VLC instance currently connected to the bus */ * the only VLC instance currently connected to the bus */
dbus_bus_request_name( p_conn, DBUS_MPRIS_BUS_NAME, 0, NULL ); 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 ); dbus_connection_flush( p_conn );
p_intf->p_sys = p_sys; p_intf->p_sys = p_sys;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment