[banshee] Mpris: Use PlayerEngine to get the current track (bgo#648498)
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] Mpris: Use PlayerEngine to get the current track (bgo#648498)
- Date: Fri, 19 Aug 2011 13:36:57 +0000 (UTC)
commit 360d92fe9673645b5453149df5cd196849417d4a
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Fri Aug 19 15:23:26 2011 +0200
Mpris: Use PlayerEngine to get the current track (bgo#648498)
As PlaybackController.CurrentTrack is updated when the StartOfStream is
raised, there is no guarantee that it will be up-to-date when the Mpris
extension processes that same event. PlayerEngine.CurrentTrack is
updated before the event is raised, so it will always contain the track
that is starting to play.
This will prevent the Mpris extension from sending the metadata from the
previous track with the PropertiesChanged signal.
.../Banshee.Mpris/Banshee.Mpris/MediaPlayer.cs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/Extensions/Banshee.Mpris/Banshee.Mpris/MediaPlayer.cs b/src/Extensions/Banshee.Mpris/Banshee.Mpris/MediaPlayer.cs
index 4d853da..03e6b8d 100644
--- a/src/Extensions/Banshee.Mpris/Banshee.Mpris/MediaPlayer.cs
+++ b/src/Extensions/Banshee.Mpris/Banshee.Mpris/MediaPlayer.cs
@@ -243,7 +243,7 @@ namespace Banshee.Mpris
public IDictionary<string, object> Metadata {
get {
- var metadata = new Metadata (playback_service.CurrentTrack);
+ var metadata = new Metadata (engine_service.CurrentTrack);
return metadata.DataStore;
}
}
@@ -300,7 +300,7 @@ namespace Banshee.Mpris
// position is in microseconds, we speak in milliseconds
long position_ms = position / 1000;
- if (position_ms < 0 || position_ms > playback_service.CurrentTrack.Duration.TotalMilliseconds) {
+ if (position_ms < 0 || position_ms > engine_service.CurrentTrack.Duration.TotalMilliseconds) {
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]