[vlc-commits] Fix Rate property on org.mpris.MediaPlayer2.Player
Alex Merry
git at videolan.org
Mon Jan 28 21:43:48 CET 2013
vlc | branch: master | Alex Merry <dev at randomguy3.me.uk> | Mon Jan 28 11:54:16 2013 +0000| [8f754d8715c72abc4ba1b0f26ae136c1db41437b] | committer: Mirsal Ennaime
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: Mirsal Ennaime <mirsal at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8f754d8715c72abc4ba1b0f26ae136c1db41437b
---
modules/control/dbus/dbus.c | 5 +++++
modules/control/dbus/dbus_player.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index 6f58bad..1ab1ac3 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -519,6 +519,11 @@ static void ProcessEvents( intf_thread_t *p_intf,
{
case SIGNAL_ITEM_CURRENT:
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 );
break;
case SIGNAL_INTF_CHANGE:
diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 5d24af1..bb9b6db 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -520,7 +520,7 @@ MarshalRate( intf_thread_t *p_intf, DBusMessageIter *container )
vlc_object_release( (vlc_object_t*) p_input );
}
else
- d_rate = 0.;
+ d_rate = 1.0;
dbus_message_iter_append_basic( container, DBUS_TYPE_DOUBLE, &d_rate );
}
More information about the vlc-commits
mailing list