- # Create the seek event
- seek_event = Gst.Event.new_seek(rate,
- Gst.Format.TIME,
- Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE,
- Gst.SeekType.SET, position,
- Gst.SeekType.SET, -1)
+ def set_seek(self, position):
+ flags = Gst.SeekFlags.SKIP | Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE
+
+ 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)