[vlc-commits] dbus fixes
Rafaël Carré
git at videolan.org
Thu May 19 05:43:00 CEST 2011
vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Wed May 18 23:07:21 2011 -0400| [d4c5140c5308d3f1d1ea3332fe4c6efd7bbf23eb] | committer: Rafaël Carré
dbus fixes
really route messages to tracklist interface
fix DBUS_MPRIS_TRACKLIST_INTERFACE definition
fix CanQuit/CanRaise/HasTracklist input types
fix AddTrack function
The function has changed in mpris 2.1, but the additional parameter isn't being used by VLC (yet)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d4c5140c5308d3f1d1ea3332fe4c6efd7bbf23eb
---
modules/control/dbus/dbus.c | 3 +++
modules/control/dbus/dbus_root.c | 6 +++---
modules/control/dbus/dbus_tracklist.c | 8 +++-----
modules/control/dbus/dbus_tracklist.h | 4 ++--
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index b5ffe53..1761ad8 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -818,6 +818,9 @@ MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this )
if( !strcmp( psz_target_interface, DBUS_MPRIS_PLAYER_INTERFACE ) )
return handle_player( p_conn, p_from, p_this );
+ if( !strcmp( psz_target_interface, DBUS_MPRIS_TRACKLIST_INTERFACE ) )
+ return handle_tracklist( p_conn, p_from, p_this );
+
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
diff --git a/modules/control/dbus/dbus_root.c b/modules/control/dbus/dbus_root.c
index 96f8868..579d556 100644
--- a/modules/control/dbus/dbus_root.c
+++ b/modules/control/dbus/dbus_root.c
@@ -64,7 +64,7 @@ DBUS_METHOD( CanQuit )
const dbus_bool_t b_ret = TRUE;
DBusMessageIter v;
- dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "s", &v );
+ dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "b", &v );
dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret );
if( !dbus_message_iter_close_container( &args, &v ) )
@@ -82,7 +82,7 @@ DBUS_METHOD( CanRaise )
const dbus_bool_t b_ret = FALSE;
DBusMessageIter v;
- dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "s", &v );
+ dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "b", &v );
dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret );
if( !dbus_message_iter_close_container( &args, &v ) )
@@ -100,7 +100,7 @@ DBUS_METHOD( HasTrackList )
const dbus_bool_t b_ret = FALSE;
DBusMessageIter v;
- dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "s", &v );
+ dbus_message_iter_open_container( &args, DBUS_TYPE_VARIANT, "b", &v );
dbus_message_iter_append_basic( &v, DBUS_TYPE_BOOLEAN, &b_ret );
if( !dbus_message_iter_close_container( &args, &v ) )
diff --git a/modules/control/dbus/dbus_tracklist.c b/modules/control/dbus/dbus_tracklist.c
index a945e0d..6fa8178 100644
--- a/modules/control/dbus/dbus_tracklist.c
+++ b/modules/control/dbus/dbus_tracklist.c
@@ -39,16 +39,16 @@
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 );
- char *psz_mrl;
+ char *psz_mrl, *psz_aftertrack;
dbus_bool_t b_play;
dbus_message_get_args( p_from, &error,
DBUS_TYPE_STRING, &psz_mrl,
+ DBUS_TYPE_OBJECT_PATH, &psz_aftertrack,
DBUS_TYPE_BOOLEAN, &b_play,
DBUS_TYPE_INVALID );
@@ -60,13 +60,11 @@ DBUS_METHOD( AddTrack )
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
+#warning psz_aftertrack is not used
playlist_Add( PL, psz_mrl, NULL, PLAYLIST_APPEND |
( ( b_play == TRUE ) ? PLAYLIST_GO : 0 ) ,
PLAYLIST_END, true, false );
- dbus_int32_t i_success = 0;
- ADD_INT32( &i_success );
-
REPLY_SEND;
}
diff --git a/modules/control/dbus/dbus_tracklist.h b/modules/control/dbus/dbus_tracklist.h
index a97e30d..c6cb599 100644
--- a/modules/control/dbus/dbus_tracklist.h
+++ b/modules/control/dbus/dbus_tracklist.h
@@ -31,8 +31,8 @@
#include <vlc_interface.h>
#include "dbus_common.h"
-#define DBUS_MPRIS_TRACKLIST_INTERFACE "org.mpris.MediaPlayer.TrackList"
-#define DBUS_MPRIS_TRACKLIST_PATH "/org/mpris/MediaPlayer/TrackList"
+#define DBUS_MPRIS_TRACKLIST_INTERFACE "org.mpris.MediaPlayer2.TrackList"
+#define DBUS_MPRIS_TRACKLIST_PATH "/org/mpris/MediaPlayer2/TrackList"
/* Handle incoming dbus messages */
DBusHandlerResult handle_tracklist ( DBusConnection *p_conn,
More information about the vlc-commits
mailing list