* 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.
This commit is contained in:
Thomas Vander Stichele
2011-05-23 18:08:25 +00:00
parent eef8b18435
commit c314dcb597
2 changed files with 13 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
2011-05-23 Thomas Vander Stichele <thomas at apestaart dot org>
* 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 <thomas at apestaart dot org>
* morituri/common/encode.py:

View File

@@ -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)