[gnome-music/wip/mschraal/player-factor-out-gstreamer] gstplayer: Start state is STOPPED



commit 4e136f7d8ddd12acbab9db4751f1bb02132965a3
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat Feb 17 23:23:42 2018 +0100

    gstplayer: Start state is STOPPED

 gnomemusic/gstplayer.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index e38ec82..dc830e5 100644
--- a/gnomemusic/gstplayer.py
+++ b/gnomemusic/gstplayer.py
@@ -82,6 +82,8 @@ class GstPlayer(GObject.GObject):
         self._bus.connect(
             'message::duration-changed', self._on_duration_changed)
 
+        self.state = Playback.STOPPED
+
     @log
     def _setup_replaygain(self):
         """Set up replaygain"""
@@ -116,7 +118,6 @@ class GstPlayer(GObject.GObject):
 
     @log
     def _on_bus_state_changed(self, bus, message):
-        print(message.type, self.state)
         # Note: not all state changes are signaled through here, in
         # particular transitions between Gst.State.READY and
         # Gst.State.NULL are never async and thus don't cause a
@@ -178,6 +179,7 @@ class GstPlayer(GObject.GObject):
     @log
     def _get_playback_status(self):
         ok, state, pending = self._player.get_state(0)
+
         if ok == Gst.StateChangeReturn.ASYNC:
             state = pending
         elif (ok != Gst.StateChangeReturn.SUCCESS):


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