Commit 9f06ab5d authored by Alexandru Băluț's avatar Alexandru Băluț

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
parent cfa489d2
Pipeline #27115 passed with stages
in 78 minutes and 38 seconds
...@@ -422,9 +422,10 @@ class SimplePipeline(GObject.Object, Loggable): ...@@ -422,9 +422,10 @@ class SimplePipeline(GObject.Object, Loggable):
Gst.DebugGraphDetails.ALL, Gst.DebugGraphDetails.ALL,
"pitivi.error") "pitivi.error")
if not self._rendering(): if not self._rendering():
self._removeWaitingForAsyncDoneTimeout()
self._recover() self._recover()
elif message.type == Gst.MessageType.DURATION_CHANGED: 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) GLib.idle_add(self._queryDurationAsync)
elif message.type == Gst.MessageType.ASYNC_DONE: elif message.type == Gst.MessageType.ASYNC_DONE:
self.debug("Async done, ready for action") self.debug("Async done, ready for action")
...@@ -459,21 +460,19 @@ class SimplePipeline(GObject.Object, Loggable): ...@@ -459,21 +460,19 @@ class SimplePipeline(GObject.Object, Loggable):
def _recover(self): def _recover(self):
if not self._bus: if not self._bus:
raise PipelineError("Should not try to recover after destroy") raise PipelineError("Should not try to recover after destroy")
if self._attempted_recoveries == MAX_RECOVERIES: if self._attempted_recoveries == MAX_RECOVERIES:
self.emit("died") self.emit("died")
self.error( self.error("Declaring pipeline dead, because %d successive reset attempts failed", MAX_RECOVERIES)
"Pipeline error detected multiple times in a row, not resetting anymore")
return return
self.error("Pipeline error detected during playback, resetting" self._attempted_recoveries += 1
" -- num tries: %d", self._attempted_recoveries) self.error("Resetting pipeline because error detected during playback. "
"Try %d", self._attempted_recoveries)
self.setState(Gst.State.NULL) self.setState(Gst.State.NULL)
self._recovery_state = self.RecoveryState.STARTED_RECOVERING self._recovery_state = self.RecoveryState.STARTED_RECOVERING
self.pause() self.pause()
self._attempted_recoveries += 1
def _queryDurationAsync(self, *unused_args, **unused_kwargs): def _queryDurationAsync(self, *unused_args, **unused_kwargs):
try: try:
self.getDuration() self.getDuration()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment