Stricter state trsnsition checks
authorAntonio Ospite <ospite@studenti.unina.it>
Tue, 5 Mar 2013 15:29:49 +0000 (16:29 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Tue, 5 Mar 2013 15:30:23 +0000 (16:30 +0100)
gst-trick-mode-looping-1.py
gst-trick-mode-looping-2.py
gst-trick-mode.py

index e0e496c..fe00556 100755 (executable)
@@ -46,7 +46,7 @@ class Player:
         print 'on_state_changed'
         old_state, new_state, pending = msg.parse_state_changed()
         print "%s -> %s" % (old_state, new_state)
-        if new_state == gst.STATE_PAUSED:
+        if old_state == gst.STATE_READY and new_state == gst.STATE_PAUSED:
             self.set_rate(self._rate)
 
     def set_rate(self, rate):
index 6bbd6e6..920677d 100755 (executable)
@@ -54,7 +54,7 @@ class Player:
         print 'on_state_changed'
         old_state, new_state, pending = msg.parse_state_changed()
         print "%s -> %s" % (old_state, new_state)
-        if new_state == gst.STATE_PAUSED:
+        if old_state == gst.STATE_READY and new_state == gst.STATE_PAUSED:
             self.set_rate(self._rate)
 
     def set_rate(self, rate):
index d741b59..a4e063f 100755 (executable)
@@ -35,7 +35,7 @@ class Player:
         print 'on_state_changed'
         old_state, new_state, pending = msg.parse_state_changed()
         print "%s -> %s" % (old_state, new_state)
-        if new_state == gst.STATE_PAUSED:
+        if old_state == gst.STATE_READY and new_state == gst.STATE_PAUSED:
             self.set_rate(self._rate)
 
     def set_rate(self, rate):