From c314dcb597e4372b283217ab4505a53b1ea01166 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 23 May 2011 18:08:25 +0000 Subject: [PATCH] * morituri/common/gstreamer.py: Stop task when we get an exception. Don't make pipeline go to PLAYING if we got an exception before doing so. --- ChangeLog | 7 +++++++ morituri/common/gstreamer.py | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5de7d68..309d23f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-05-23 Thomas Vander Stichele + + * morituri/common/gstreamer.py: + Stop task when we get an exception. + Don't make pipeline go to PLAYING if we got an exception + before doing so. + 2011-05-23 Thomas Vander Stichele * morituri/common/encode.py: diff --git a/morituri/common/gstreamer.py b/morituri/common/gstreamer.py index 1cf7b98..250206d 100644 --- a/morituri/common/gstreamer.py +++ b/morituri/common/gstreamer.py @@ -87,6 +87,10 @@ class GstPipelineTask(task.Task): # gst.STATE_PLAYING) # would not work. def playLater(): + if self.exception: + self.debug('playLater: exception was raised, not playing') + return False + self.debug('setting pipeline to PLAYING') self.pipeline.set_state(self.gst.STATE_PLAYING) self.debug('set pipeline to PLAYING') @@ -95,7 +99,6 @@ class GstPipelineTask(task.Task): self.debug('scheduling setting pipeline to PLAYING') self.runner.schedule(0, playLater) - def stop(self): self.debug('stopping') self.debug('setting state to NULL') @@ -156,6 +159,5 @@ class GstPipelineTask(task.Task): """ exc = GstException(*message.parse_error()) self.setAndRaiseException(exc) - # FIXME: why is this commented ? - # self.gst.debug('error, scheduling stop') - #self.runner.schedule(0, self.stop) + self.debug('error, scheduling stop') + self.runner.schedule(0, self.stop)