+ def set_seek(self, position, flush=False):
+ flags = Gst.SeekFlags.SEGMENT | Gst.SeekFlags.SKIP | Gst.SeekFlags.ACCURATE
+
+ if flush:
+ flags |= Gst.SeekFlags.FLUSH
+
+ if self._rate >= 0:
+ seek_event = Gst.Event.new_seek(self._rate,
+ Gst.Format.TIME,
+ flags,
+ Gst.SeekType.SET, position,
+ Gst.SeekType.NONE, 0)
+ else:
+ seek_event = Gst.Event.new_seek(self._rate,
+ Gst.Format.TIME,
+ flags,
+ Gst.SeekType.NONE, 0,
+ Gst.SeekType.END, position)
+
+ if seek_event:
+ self._player.send_event(seek_event)
+ Gst.info("rate set to %s" % self._rate)