[gstreamer-bugs] appsrc and seek data.

Adam Panayis adam at movency.com
Thu Oct 22 03:18:18 PDT 2009


Hi, I am having a problem using appsrc and seeking to a position in a file.

I would like to be able to seek to a point in a file without reading all
of the data up to that point into gstreamer.

I am using this function to seek:

gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME,
(GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
GST_SEEK_TYPE_SET, offset, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)

The problem when doing this is that my need-data callback function
simply loops though loading data from the current position to the seeked
to position and then continues playing. I do not want to loop through
the data in between as I am streaming and may not have this data yet.

I have played with the SEEK flags and when not using
GST_SEEK_FLAG_ACCURATE I am able to seek to the exact point I have asked
for without reading in the data in between BUT I then get way too many
calls to feed data after the seeked to point. The amount of data asked
for after this point seems proportional to my position in the file. i.e
If I seek to point more than halfway though my file, I load the rest of
the file and come to EOS.

Any help appreciated..
Thanks.
Adam





More information about the Gstreamer-bugs mailing list