[gnome-music/wip/mschraal/gapless-v3: 24/24] player: Simplify gapless



commit a02c698bb94732f2d3f304fe289b907590102c45
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Oct 22 10:58:20 2018 +0200

    player: Simplify gapless

 gnomemusic/player.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 937c59b9..f8a0e866 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -639,16 +639,15 @@ class Player(GObject.GObject):
     @log
     def _on_eos(self, klass, gapless=False):
         print("eos, gapless:", gapless)
+        if not gapless:
+            GLib.idle_add(self.stop)
+
+            return
 
         if self.props.has_next:
             self._playlist.next()
-            if gapless:
-                new_url = self._playlist.props.current_song.get_url()
-                self._gst_player.props.url = new_url
-            else:
-                GLib.idle_add(self.play)
-        else:
-            GLib.idle_add(self.stop)
+            new_url = self._playlist.props.current_song.get_url()
+            self._gst_player.props.url = new_url
 
     @log
     def _on_stream_start(self, klass):


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