[gst-devel] gst_element_seek problem

Sebastien Moutte sebastien at moutte.net
Mon Jul 2 18:07:04 CEST 2007


Hey,
So you finally succeeded to get the video displayed in your Xwindow
application using the XOverlay interface of directdrawsink ?
Hm, your need of a Sleep to enable the seek operation is really strange. 
Can you give us your threading model ? what are the threads initializing
GStreamer, calling seek function, running g_main_loop ...
Regards,
Sebastien

-----Original Message-----
From: gstreamer-devel-bounces at lists.sourceforge.net
[mailto:gstreamer-devel-bounces at lists.sourceforge.net] On Behalf Of bounce
bounce
Sent: lundi 2 juillet 2007 16:56
To: gstreamer-devel treamer devel mailing list
Subject: [gst-devel] gst_element_seek problem

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