Commit 34cc9763 authored by Alex Merry's avatar Alex Merry Committed by Rémi Denis-Courmont

Fix Rate property on org.mpris.MediaPlayer2.Player

Rate should never be 0.0 (according to the spec), so we pick a sensible
default when we do not have a current track: 1.0.

Also, when the current item changes, the Rate may also change.  So add
it to the PropertiesChanged signal just to be sure.
Signed-off-by: default avatarMirsal Ennaime <mirsal@videolan.org>
(cherry picked from commit 8f754d8715c72abc4ba1b0f26ae136c1db41437b)
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent e8292719
...@@ -506,6 +506,11 @@ static void ProcessEvents( intf_thread_t *p_intf, ...@@ -506,6 +506,11 @@ static void ProcessEvents( intf_thread_t *p_intf,
{ {
case SIGNAL_ITEM_CURRENT: case SIGNAL_ITEM_CURRENT:
TrackChange( p_intf ); TrackChange( p_intf );
// rate depends on current item
if( !vlc_dictionary_has_key( &tracklist_properties, "Rate" ) )
vlc_dictionary_insert( &player_properties, "Rate", NULL );
vlc_dictionary_insert( &player_properties, "Metadata", NULL ); vlc_dictionary_insert( &player_properties, "Metadata", NULL );
break; break;
case SIGNAL_INTF_CHANGE: case SIGNAL_INTF_CHANGE:
......
...@@ -523,7 +523,7 @@ MarshalRate( intf_thread_t *p_intf, DBusMessageIter *container ) ...@@ -523,7 +523,7 @@ MarshalRate( intf_thread_t *p_intf, DBusMessageIter *container )
vlc_object_release( (vlc_object_t*) p_input ); vlc_object_release( (vlc_object_t*) p_input );
} }
else else
d_rate = 0.; d_rate = 1.0;
dbus_message_iter_append_basic( container, DBUS_TYPE_DOUBLE, &d_rate ); dbus_message_iter_append_basic( container, DBUS_TYPE_DOUBLE, &d_rate );
} }
......
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