[gst-devel] seeking to byte_offset report

Joshua N Pritikin vishnu at pobox.com
Sat Nov 23 22:55:03 CET 2002


To seek to a byte_offset, i am using this code and it seems to work:

  gst_element_set_state (fv->player->pipeline, GST_STATE_PAUSED);

  GstEvent *seek_event =
    gst_event_new_seek (GST_FORMAT_BYTES |
			GST_SEEK_METHOD_SET |
			GST_SEEK_FLAG_FLUSH, byte_offset);

  gint ok =
    gst_pad_send_event (gst_element_get_pad (fv->player->source, "src"), seek_event);
  if (!ok)
    g_warning ("seek to 0x%llx failed", byte_offset);

  gst_element_send_event (fv->player->video_sink_element,
			  gst_event_new_flush ());
  gst_element_send_event (fv->player->audio_sink_element,
			  gst_event_new_flush ());

  gst_element_set_state (fv->player->pipeline, GST_STATE_PLAYING);

-- 
Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org




More information about the gstreamer-devel mailing list