[pitivi/1.0] pipeline: Declare pipeline dead only once



commit 287b932c56473cf8459e6dd8b4867a037a45532f
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sun Aug 26 15:24:55 2018 +0200

    pipeline: Declare pipeline dead only once
    
    The pipeline was being declared dead first when an error was reported on
    the bus, and second when the async-done was not being received.
    
    Fixes #2232

 pitivi/utils/pipeline.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index ddafd6ef..ba53c85c 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -422,9 +422,10 @@ class SimplePipeline(GObject.Object, Loggable):
                                               Gst.DebugGraphDetails.ALL,
                                               "pitivi.error")
             if not self._rendering():
+                self._removeWaitingForAsyncDoneTimeout()
                 self._recover()
         elif message.type == Gst.MessageType.DURATION_CHANGED:
-            self.debug("Duration might have changed, querying it")
+            self.debug("Querying duration async, because it changed")
             GLib.idle_add(self._queryDurationAsync)
         elif message.type == Gst.MessageType.ASYNC_DONE:
             self.debug("Async done, ready for action")
@@ -459,21 +460,19 @@ class SimplePipeline(GObject.Object, Loggable):
     def _recover(self):
         if not self._bus:
             raise PipelineError("Should not try to recover after destroy")
+
         if self._attempted_recoveries == MAX_RECOVERIES:
             self.emit("died")
-            self.error(
-                "Pipeline error detected multiple times in a row, not resetting anymore")
+            self.error("Declaring pipeline dead, because %d successive reset attempts failed", 
MAX_RECOVERIES)
             return
 
-        self.error("Pipeline error detected during playback, resetting"
-                   " -- num tries: %d", self._attempted_recoveries)
-
+        self._attempted_recoveries += 1
+        self.error("Resetting pipeline because error detected during playback. "
+                   "Try %d", self._attempted_recoveries)
         self.setState(Gst.State.NULL)
         self._recovery_state = self.RecoveryState.STARTED_RECOVERING
         self.pause()
 
-        self._attempted_recoveries += 1
-
     def _queryDurationAsync(self, *unused_args, **unused_kwargs):
         try:
             self.getDuration()


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