Only block after seek before starting to play to ensure that seek has happened
This commit is contained in:
parent
222bbf4998
commit
1132f554c7
@ -176,10 +176,6 @@ class GStreamerProcess(BaseProcess):
|
|||||||
if result == gst.STATE_CHANGE_FAILURE:
|
if result == gst.STATE_CHANGE_FAILURE:
|
||||||
logger.warning('Setting GStreamer state to %s: failed', state_name)
|
logger.warning('Setting GStreamer state to %s: failed', state_name)
|
||||||
return False
|
return False
|
||||||
elif result == gst.STATE_CHANGE_ASYNC:
|
|
||||||
# Block until ready
|
|
||||||
self.gst_pipeline.get_state()
|
|
||||||
return True
|
|
||||||
else:
|
else:
|
||||||
logger.debug('Setting GStreamer state to %s: OK', state_name)
|
logger.debug('Setting GStreamer state to %s: OK', state_name)
|
||||||
return True
|
return True
|
||||||
@ -197,6 +193,7 @@ class GStreamerProcess(BaseProcess):
|
|||||||
def set_position(self, position):
|
def set_position(self, position):
|
||||||
self.gst_pipeline.seek_simple(gst.Format(gst.FORMAT_TIME),
|
self.gst_pipeline.seek_simple(gst.Format(gst.FORMAT_TIME),
|
||||||
gst.SEEK_FLAG_FLUSH, position * gst.MSECOND)
|
gst.SEEK_FLAG_FLUSH, position * gst.MSECOND)
|
||||||
|
self.gst_pipeline.get_state() # Block until state change
|
||||||
self.set_state('PLAYING')
|
self.set_state('PLAYING')
|
||||||
|
|
||||||
def get_position(self):
|
def get_position(self):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user