[pitivi] Pause pipeline when receiving the 'eos' signal



commit c1f195ceaa311cf1469882ad1ad8b560d98e9fcb
Author: Volker Sobek <reklov live com>
Date:   Mon Mar 22 19:03:34 2010 +0100

    Pause pipeline when receiving the 'eos' signal
    
    Also emit the 'position' signal after setting the state of a
    pipeline to PAUSED, to update the UI.
    
    Fixes
    https://bugzilla.gnome.org/show_bug.cgi?id=610060
    https://bugzilla.gnome.org/show_bug.cgi?id=613625

 pitivi/pipeline.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/pipeline.py b/pitivi/pipeline.py
index ea1ad7e..d6e8507 100644
--- a/pitivi/pipeline.py
+++ b/pitivi/pipeline.py
@@ -292,6 +292,16 @@ class Pipeline(Signallable, Loggable):
         """
         self.setState(STATE_PAUSED)
 
+        # When the pipeline has been paused we need to update the
+        # timeline/playhead position, as the 'position' signal
+        # is only emitted every 300ms and the playhead jumps
+        # during the playback.
+        try:
+            self.emit("position", self.getPosition())
+        except PipelineError:
+            # Getting the position failed
+            pass
+
     def stop(self):
         """
         Sets the L{Pipeline} to READY
@@ -775,6 +785,7 @@ class Pipeline(Signallable, Loggable):
 
     def _busMessageCb(self, unused_bus, message):
         if message.type == gst.MESSAGE_EOS:
+            self.pause()
             self.emit('eos')
         elif message.type == gst.MESSAGE_STATE_CHANGED:
             prev, new, pending = message.parse_state_changed()



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