[gst-devel] backward seeking

Rov Juvano rovjuvano at users.sourceforge.net
Sat Jul 26 16:55:24 CEST 2008


On Fri, Jul 25, 2008 at 08:08:49PM +0000, Ash wrote:
> Has any developer out there gotten backward seek (negative rate) to work with GST_FORMAT_TIME?

Yep.

  gint64 start_pos, stop_pos;
  if (rate > 0) {
    start_pos = new_pos;
    stop_pos = -1; // or whatever > new_pos
  } else {
    start_pos = 0; // or whatever < new_pos
    stop_pos = new_pos;
  }
  if (!gst_element_seek (pipeline, rate,
        GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
        GST_SEEK_TYPE_SET, start_pos,
        GST_SEEK_TYPE_SET, stop_pos)) {
    g_message ("Seek failed");
  }

I've only had luck with ogg-vorbis and ogg-theora.





More information about the gstreamer-devel mailing list