[gst-devel] Fwd: trouble seeking in local files

Edward Hervey edward.hervey at collabora.co.uk
Sat Aug 16 10:13:30 CEST 2008


Hi,

On Sat, 2008-08-16 at 01:47 -0400, Soren Harward wrote:
> I need some help figuring out seeking.  I've been writing a small
> command-line player to learn GStreamer programming, and have hit a
> total wall trying to figure out seeking.  I'm setting up a pipeline as
> follows:
> 
> filesrc -> decodebin -> audioconvert -> audioresample -> alsasink
> 
> It plays files just fine.  But then I add the following after the
> pipeline is set up:
> 
>    gst_element_set_state(pipeline, GST_STATE_PAUSED);

  You are not waiting for the confirmation that your pipeline has
properly pre-rolled (reached the PAUSED state). Simply put, Seeks can
only work when the pipeline is either in the PAUSED or PLAYING state.

  You should wait for the GST_MESSAGE_STATE_CHANGED message on the bus
from the pipeline stating it has successfully changed state to PAUSED
before sending that seek.

>    if (!gst_element_seek_simple(pipeline, GST_FORMAT_TIME,
> GST_SEEK_FLAG_FLUSH, 3e10)) {
>        g_printerr("simple seek failed\n");
>    }
>    gst_element_set_state(pipeline, GST_STATE_PLAYING);
> 
> The seek fails and the file starts playing from the beginning.  I've
> tried all permutations of seek flags, I've tried the more advanced
> gst_element_seek, and nothing I've tried has worked.  I'm attaching my
> full source code.  Could someone please give me a hand here?  Thanks.
> 
> --
> Soren Harward
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-- 
Edward Hervey <edward.hervey at collabora.co.uk>
Collabora Multimedia





More information about the gstreamer-devel mailing list