[vlc-devel] commit: Dbus control module: * Add missing MPRIS capability * GetCaps should not try to update capabilities * Check for capabilities on input state change rather than on track change (Mirsal Ennaime )
git version control
git at videolan.org
Tue Mar 25 02:25:07 CET 2008
vlc | branch: master | Mirsal Ennaime <mirsal.ennaime at gmail.com> | Thu Mar 20 03:36:19 2008 +0100| [13fac46da68e7c2218d0318014f33f2bbbf0a9fb]
Dbus control module: * Add missing MPRIS capability * GetCaps should not try to update capabilities * Check for capabilities on input state change rather than on track change
Signed-off-by: Mirsal Ennaime <mirsal.ennaime at gmail.com>
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13fac46da68e7c2218d0318014f33f2bbbf0a9fb
---
modules/control/dbus.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/modules/control/dbus.c b/modules/control/dbus.c
index 26e07e4..b53f5d2 100644
--- a/modules/control/dbus.c
+++ b/modules/control/dbus.c
@@ -89,7 +89,8 @@ enum
CAPS_CAN_PAUSE = 1 << 2,
CAPS_CAN_PLAY = 1 << 3,
CAPS_CAN_SEEK = 1 << 4,
- CAPS_CAN_PROVIDE_METADATA = 1 << 5
+ CAPS_CAN_PROVIDE_METADATA = 1 << 5,
+ CAPS_CAN_HAS_TRACKLIST = 1 << 6
};
struct intf_sys_t
@@ -308,7 +309,6 @@ DBUS_METHOD( GetCaps )
REPLY_INIT;
OUT_ARGUMENTS;
- UpdateCaps( (intf_thread_t*)p_this );
ADD_INT32( &((intf_thread_t*)p_this)->p_sys->i_caps );
REPLY_SEND;
@@ -884,6 +884,8 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var,
if( p_intf->b_dead )
return VLC_SUCCESS;
+ UpdateCaps( p_intf );
+
if( !p_sys->b_meta_read && newval.i_int == PLAYING_S )
{
input_item_t *p_item = input_GetItem( (input_thread_t*)p_this );
@@ -900,7 +902,6 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var,
StatusChangeSignal( p_sys->p_conn, (void*) p_intf );
}
-
return VLC_SUCCESS;
}
@@ -969,8 +970,6 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var,
TrackChangeSignal( p_sys->p_conn, p_item );
}
- UpdateCaps( p_intf );
-
var_AddCallback( p_input, "state", StateChange, p_intf );
vlc_object_release( p_input );
@@ -982,7 +981,7 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var,
****************************************************************************/
static int UpdateCaps( intf_thread_t* p_intf )
{
- dbus_int32_t i_caps = CAPS_NONE;
+ dbus_int32_t i_caps = CAPS_CAN_HAS_TRACKLIST;
playlist_t* p_playlist = pl_Yield( (vlc_object_t*)p_intf );
PL_LOCK;
More information about the vlc-devel
mailing list