Only block after seek before starting to play to ensure that seek has happened

This commit is contained in:
Thomas Adamcik 2010-08-19 01:01:32 +02:00
parent 222bbf4998
commit 1132f554c7

View File

@ -176,10 +176,6 @@ class GStreamerProcess(BaseProcess):
if result == gst.STATE_CHANGE_FAILURE:
logger.warning('Setting GStreamer state to %s: failed', state_name)
return False
elif result == gst.STATE_CHANGE_ASYNC:
# Block until ready
self.gst_pipeline.get_state()
return True
else:
logger.debug('Setting GStreamer state to %s: OK', state_name)
return True
@ -197,6 +193,7 @@ class GStreamerProcess(BaseProcess):
def set_position(self, position):
self.gst_pipeline.seek_simple(gst.Format(gst.FORMAT_TIME),
gst.SEEK_FLAG_FLUSH, position * gst.MSECOND)
self.gst_pipeline.get_state() # Block until state change
self.set_state('PLAYING')
def get_position(self):