Skip to content
Snippets Groups Projects
Commit 1c037bc6 authored by Marvin Scholz's avatar Marvin Scholz Committed by Felix Paul Kühne
Browse files

control: dbus: emit events properly on input change

The can-seek and can-pause variables could end up
not being set, as the callback events are not reliably
fired in case the variables changed before the callbacks
are attached.
Additionally we need to report the playback status properly
whenever a new item starts playing.

Fix #24699
parent 94035013
No related branches found
No related tags found
2 merge requests!3533Backport MR 3236 to 3.0.x,!2842[3.0.x] Fix MRPIS dbus inconsistencies
......@@ -541,14 +541,32 @@ static void ProcessEvents( intf_thread_t *p_intf,
switch( p_events[i]->signal )
{
case SIGNAL_ITEM_CURRENT:
{
TrackChange( p_intf );
// Update status when new item starts playing
// Just relying on the variables change callbacks is not enough
// as by the time the callbacks are attached, we might already
// have missed a change, so we need to query and set the initial
// values reliably here.
vlc_dictionary_insert( &player_properties, "PlaybackStatus", NULL );
input_thread_t *p_input = pl_CurrentInput( p_intf );
if( p_input )
{
if ( var_GetBool( p_input, "can-pause" ) )
vlc_dictionary_insert( &player_properties, "CanPause", NULL );
if ( var_GetBool( p_input, "can-seek" ) )
vlc_dictionary_insert( &player_properties, "CanSeek", NULL );
vlc_object_release( p_input );
}
// rate depends on current item
if( !vlc_dictionary_has_key( &player_properties, "Rate" ) )
vlc_dictionary_insert( &player_properties, "Rate", NULL );
vlc_dictionary_insert( &player_properties, "Metadata", NULL );
break;
}
case SIGNAL_PLAYLIST_ITEM_APPEND:
case SIGNAL_PLAYLIST_ITEM_DELETED:
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment