[gst-devel] gst_element_seek problem

bounce bounce bouncebounce at caramail.com
Mon Jul 2 16:56:17 CEST 2007


Hi,
 
I'm developing an application in C with a GUI in Xwindow.

I'm using a "playbin" GStreamer element to read video files.

My problem is that when I'm using the "gst_element_seek" function, the video is not seeking where I want and next if I play the video, it is played from its last position and not from the wanted position.
I must repeat the operation twice with a Sleep to seek the video where I want.

Here you have the code used to seek the video :


if ( ! gst_element_set_state(playbin, GST_STATE_PAUSED) ) {
                printf("Couldn't set player to GST_STATE_PAUSED state.");
                exit (EXIT_FAILURE);
}

// seeking to the beginnig of the video
if ( ! gst_element_seek(vsink, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE) ) {
               printf("Error while executing gst_element_seek in video_seek function.");
               exit (EXIT_FAILURE);
}


The video is paused but the seeking is not right.

Is the way I took myself to do that wrong ?
Could you help me ?


More information about the gstreamer-devel mailing list