[banshee] MediaEngine: Prevent NRE, increment last played on EoS



commit 34efa76908152549378002197bf8b22a7357dbfb
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon Mar 28 13:59:27 2011 -0500

    MediaEngine: Prevent NRE, increment last played on EoS

 .../Banshee.MediaEngine/PlayerEngineService.cs     |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
index 8d30711..59bcf72 100644
--- a/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
+++ b/src/Core/Banshee.Services/Banshee.MediaEngine/PlayerEngineService.cs
@@ -230,6 +230,8 @@ namespace Banshee.MediaEngine
 
             if (args.Event == PlayerEvent.StartOfStream) {
                 incremented_last_played = false;
+            } else if (args.Event == PlayerEvent.EndOfStream) {
+                IncrementLastPlayed ();
             }
 
             RaiseEvent (args);
@@ -553,7 +555,7 @@ namespace Banshee.MediaEngine
 
         public TrackInfo CurrentTrack {
             get {
-                return active_engine.CurrentTrack ?? synthesized_contacting_track;
+                return active_engine == null ? null : active_engine.CurrentTrack ?? synthesized_contacting_track;
             }
         }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]