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



commit 9bee2260f081fd158ec7599e7c396344d63cd3b4
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]