- if rate > 0:
- seek_event = gst.event_new_seek(rate,
- gst.FORMAT_TIME,
- gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE,
- gst.SEEK_TYPE_SET, position,
- gst.SEEK_TYPE_NONE, 0)
- else:
- seek_event = gst.event_new_seek(rate,
- gst.FORMAT_TIME,
- gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE,
- gst.SEEK_TYPE_SET, 0,
- gst.SEEK_TYPE_SET, position)
+ seek_event = Gst.Event.new_seek(rate,
+ Gst.Format.TIME,
+ Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE,
+ Gst.SeekType.SET, position,
+ Gst.SeekType.SET, -1)