[banshee] Gapless: fix smooth transition for RepeatSingle mode (bgo#627391)



commit e7d92886b563bf0a5999c64a280b3206b81a8aa8
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Tue Feb 18 00:02:40 2014 +0100

    Gapless: fix smooth transition for RepeatSingle mode (bgo#627391)
    
    RepeatSingle mode was setting the next track with OpenPlay() instead
    of using SetNextTrack() when receiving the RequestNextTrack event,
    which meant that the track to play next was not received in time*,
    and therefore not succeed in making the transition gapless.
    
    * The consequence of this was the following debug message:
    [23 Debug 21:47:47.275] [Gapless] Timed out while waiting for next_track_set to be raised

 .../PlaybackControllerService.cs                   |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs 
b/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs
index a881ef8..db65913 100644
--- a/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs
+++ b/src/Core/Banshee.Services/Banshee.PlaybackController/PlaybackControllerService.cs
@@ -31,7 +31,6 @@ using System;
 using Hyena;
 using Hyena.Collections;
 
-using Banshee.Base;
 using Banshee.Sources;
 using Banshee.ServiceStack;
 using Banshee.Collection;
@@ -194,7 +193,7 @@ namespace Banshee.PlaybackController
         {
             if (!StopWhenFinished) {
                 if (RepeatMode == PlaybackRepeatMode.RepeatSingle) {
-                    QueuePlayTrack ();
+                    RepeatCurrentAsNext ();
                 } else {
                     last_was_skipped = false;
                     Next (RepeatMode == PlaybackRepeatMode.RepeatAll, false);
@@ -207,6 +206,15 @@ namespace Banshee.PlaybackController
             return false;
         }
 
+        private void RepeatCurrentAsNext ()
+        {
+            raise_started_after_transition = true;
+
+            player_engine.SetNextTrack (CurrentTrack);
+
+            OnTransition ();
+        }
+
         public void First ()
         {
             CancelErrorTransition ();


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