[pitivi] Pipeline: Reset to STATE_NULL when changing state fails



commit 4b7a2fb9e2585991f15b85047400235d624ed639
Author: Edward Hervey <bilboed bilboed com>
Date:   Sat Jul 10 13:59:34 2010 +0200

    Pipeline: Reset to STATE_NULL when changing state fails
    
    If ever we fail changing to PAUSED/PLAYING, we need to ensure having
    a consistent state. This ensures the pipeline is properly resetted
    to NULL if ever that happens.

 pitivi/pipeline.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/pipeline.py b/pitivi/pipeline.py
index f8f33d7..9b1dd0c 100644
--- a/pitivi/pipeline.py
+++ b/pitivi/pipeline.py
@@ -264,7 +264,9 @@ class Pipeline(Signallable, Loggable):
         self.debug("state:%r", state)
         res = self._pipeline.set_state(state)
         if res == gst.STATE_CHANGE_FAILURE:
-            raise PipelineError("Failure changing state of the gst.Pipeline")
+            # reset to NULL
+            self._pipeline.set_state(gst.STATE_NULL)
+            raise PipelineError("Failure changing state of the gst.Pipeline to %r, currently reset to NULL" % state)
 
     def getState(self):
         """



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