[gst-devel] facing problem using GST_SEEK_TYPE_CUR in gst_element_seek

Jan Schmidt thaytan at noraisin.net
Thu May 17 19:08:15 CEST 2007

Edward Hervey wrote:
> Hi,
> If you only want to change the rate without changing the seek
> positions, use GST_SEEK_TYPE_NONE/GST_CLOCK_TIME_NONE for the start
> position also.

Actually, this will generally cause some strangeness in the seeking,
because the fast-forward will begin from the position that the SOURCE of
the pipeline has reached. Due to buffering after the decoders, this is
not the position that the user is seeing on the screen, so their
trick-mode operation will commence with a jump in the position.

What you want to do is query the current position of the playback, and
use that with GST_SEEK_TYPE_SET to begin the trickmode from the exact
position you want.

Also bear in mind that almost no decoders and demuxers currently support
backwards playback, so rate < 0 won't work in general. Fast forward and
forward slow-motion should always succeed, however.


>   Edward
> On 5/17/07, Sanjay Gupta <sanjayg417 at gmail.com> wrote:
>> Hi,
>> I want to fast forward the audio playback at rate 2.0 from the point when I
>> pressed the Forward button.
>> To do this, I am doing the following:
>> gst_element_seek (pipeline, 2.0, GST_FORMAT_TIME,
>>                                 GST_SEEK_FLAG_FLUSH,
>>                                 GST_SEEK_TYPE_CUR, //change relative to
>> current position
>>                                 0, // The value of the new current position
>>                                 GST_SEEK_TYPE_NONE,
>>                                 GST_CLOCK_TIME_NONE);
>> But it starts audio playback from the begining.
>> Can someone point out what is wrong in this?
>> Thanks a lot in advance.
>> Regards,
>> Sanjay
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

More information about the gstreamer-devel mailing list