fdsrc plugin -seek operation

satish pattar satish.pattar at gmail.com
Thu Apr 7 06:30:08 PDT 2011


Hello All,

I am trying to play an mp3 file using pipeline fdsrc ! decodebin2 !
autoaudiosink  by providing the opened file descriptor to the plugin.

When I do forward seek for n sec , it is working properly. but when I do
backward seek for n sec, then there is no sound for n sec & then plays from
the correct seek'd position.

What am I doing wrong. ?

// code snippet for seeking

void seek_handler (double displacement) // displacement is in second
  {

    GstFormat fmt = GST_FORMAT_TIME;
    gint64    cur_pos;
    gst_element_query_position (pipeline, &fmt, &cur_pos);

    double new_pos_sec = cur_pos * (1.0 / GST_SECOND) + displacement;

    seek (new_pos_sec * GST_SECOND);

  }

void  seek (gint64 new_pos)
  {
   if (new_pos < 0)
      new_pos = 0;
    gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET,
    new_pos, GST_SEEK_TYPE_NONE,  GST_CLOCK_TIME_NONE);
  }





-- 
Thanks & Regards,

Satish Pattar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110407/add49855/attachment.htm>


More information about the gstreamer-devel mailing list