Commit 13fac46d authored by Mirsal Ennaime's avatar Mirsal Ennaime Committed by Rafaël Carré

Dbus control module: * Add missing MPRIS capability * GetCaps should not try...

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: default avatarMirsal Ennaime <mirsal.ennaime@gmail.com>
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent 16364fa6
...@@ -89,7 +89,8 @@ enum ...@@ -89,7 +89,8 @@ enum
CAPS_CAN_PAUSE = 1 << 2, CAPS_CAN_PAUSE = 1 << 2,
CAPS_CAN_PLAY = 1 << 3, CAPS_CAN_PLAY = 1 << 3,
CAPS_CAN_SEEK = 1 << 4, 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 struct intf_sys_t
...@@ -308,7 +309,6 @@ DBUS_METHOD( GetCaps ) ...@@ -308,7 +309,6 @@ DBUS_METHOD( GetCaps )
REPLY_INIT; REPLY_INIT;
OUT_ARGUMENTS; OUT_ARGUMENTS;
UpdateCaps( (intf_thread_t*)p_this );
ADD_INT32( &((intf_thread_t*)p_this)->p_sys->i_caps ); ADD_INT32( &((intf_thread_t*)p_this)->p_sys->i_caps );
REPLY_SEND; REPLY_SEND;
...@@ -884,6 +884,8 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var, ...@@ -884,6 +884,8 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var,
if( p_intf->b_dead ) if( p_intf->b_dead )
return VLC_SUCCESS; return VLC_SUCCESS;
UpdateCaps( p_intf );
if( !p_sys->b_meta_read && newval.i_int == PLAYING_S ) if( !p_sys->b_meta_read && newval.i_int == PLAYING_S )
{ {
input_item_t *p_item = input_GetItem( (input_thread_t*)p_this ); 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, ...@@ -900,7 +902,6 @@ static int StateChange( vlc_object_t *p_this, const char* psz_var,
StatusChangeSignal( p_sys->p_conn, (void*) p_intf ); StatusChangeSignal( p_sys->p_conn, (void*) p_intf );
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -969,8 +970,6 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var, ...@@ -969,8 +970,6 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var,
TrackChangeSignal( p_sys->p_conn, p_item ); TrackChangeSignal( p_sys->p_conn, p_item );
} }
UpdateCaps( p_intf );
var_AddCallback( p_input, "state", StateChange, p_intf ); var_AddCallback( p_input, "state", StateChange, p_intf );
vlc_object_release( p_input ); vlc_object_release( p_input );
...@@ -982,7 +981,7 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var, ...@@ -982,7 +981,7 @@ static int TrackChange( vlc_object_t *p_this, const char *psz_var,
****************************************************************************/ ****************************************************************************/
static int UpdateCaps( intf_thread_t* p_intf ) 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 ); playlist_t* p_playlist = pl_Yield( (vlc_object_t*)p_intf );
PL_LOCK; PL_LOCK;
......
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