Hello All,<br><br>I have a basic understanding of gstreamer, the problem i am facing may be trivial , please bear with me. <br>What I am trying  to make use of playbin2 for playing a non-seekable file (I am using pipe &amp; doing &quot;cat  *.mp3 &gt; /home/my_pipe after running my app)<br>
<br>Here is my app<br>-------------------------------------------------------<br><br>include &lt;gst/gst.h&gt;<br><br>static int cnt = 0;<br>static gboolean<br>cb_print_position (GstElement *pipeline)<br>{<br>  GstFormat fmt = GST_FORMAT_TIME;<br>
  gint64 pos, len;<br><br>  if (gst_element_query_position (pipeline, &amp;fmt, &amp;pos) &amp;&amp; gst_element_query_duration (pipeline, &amp;fmt, &amp;len))<br>  {<br>      GTimeVal tv_pos, tv_len;<br>      GST_TIME_TO_TIMEVAL (pos, tv_pos);<br>
      GST_TIME_TO_TIMEVAL (len, tv_len);<br>      glong pos_min = tv_pos.tv_sec / 60;<br>      glong len_min = tv_len.tv_sec / 60;<br>      g_print (&quot;\rCount %d) : Time:   %01lu:%02lu:%02lu.%02lu&quot;, cnt++ , pos_min / 60, pos_min % 60, tv_pos.tv_sec % 60, tv_pos.tv_usec / 10000);<br>
      if (len &gt; 0)   /* streams have len == -1 */<br>        g_print (&quot; of %01lu:%02lu:%02lu.%02lu&quot;, len_min / 60, len_min % 60, tv_len.tv_sec % 60, tv_len.tv_usec / 10000);<br>  }<br><br>  if(cnt == 50)<br>  {<br>
        printf(&quot;Going to Seek for 10 sec \n&quot;);<br>        GstFormat fmt = GST_FORMAT_TIME;<br>        gint64    cur_pos;<br><br>        if (!(gst_element_query_position (pipeline, &amp;fmt, &amp;cur_pos)))<br>          printf(&quot;[player] : gst_element_query_position failed \n&quot;);<br>
<br>        g_print(&quot;The cur_pos %&quot; G_GINT64_FORMAT , cur_pos);<br><br>        double new_pos_sec = cur_pos * (1.0 / GST_SECOND) + 10; // 10 sec<br>        gint64 new_pos = new_pos_sec * GST_SECOND ;<br>        printf(&quot;new_pos = %&quot; G_GINT64_FORMAT , new_pos);<br>
        if(!(gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,<br>                      new_pos , GST_SEEK_TYPE_NONE,  GST_CLOCK_TIME_NONE)))<br>                printf(&quot;\n[player] Seek failed!! \n&quot;);<br>
        else<br>                printf(&quot;\n[Player] Seek successful \n&quot;);<br>  }<br>  return TRUE;<br>}<br><br>static gboolean<br>my_bus_callback (GstBus     *bus,<br>          GstMessage *msg,<br>          gpointer    data)<br>
{<br>  GMainLoop *loop = (GMainLoop *) data;<br>  switch (GST_MESSAGE_TYPE (msg)) {<br>    case GST_MESSAGE_EOS:<br>     g_print (&quot;End of stream\n&quot;);<br>      g_main_loop_quit (loop);<br>      break;<br>    case GST_MESSAGE_ERROR: {<br>
      gchar *debug;<br>      GError *error;<br>      gst_message_parse_error (msg, &amp;error, &amp;debug);<br>      g_free (debug);<br>      g_printerr (&quot;Error: %s\n&quot;, error-&gt;message);<br>      g_error_free (error);<br>
      g_main_loop_quit (loop);<br>      break;<br>    }<br>    default:<br>      break;<br>  }<br>  return TRUE;<br>}<br><br>gint<br>main (gint   argc,<br>      gchar *argv[])<br>{<br>  GMainLoop *loop;<br>  GstElement *play;<br>
  GstBus *bus;<br>  /* init GStreamer */<br>  gst_init (&amp;argc, &amp;argv);<br>  loop = g_main_loop_new (NULL, FALSE);<br>  /* make sure we have a URI */<br>  if (argc != 2) {<br>    g_print (&quot;Usage: %s &lt;URI&gt;\n&quot;, argv[0]);<br>
    return -1;<br>  }<br>  /* set up */<br>  play = gst_element_factory_make (&quot;playbin2&quot;, &quot;play&quot;);<br>  g_object_set (G_OBJECT (play), &quot;uri&quot;, argv[1], NULL);<br>  bus = gst_pipeline_get_bus (GST_PIPELINE (play));<br>
  gst_bus_add_watch (bus, my_bus_callback, loop);<br>  gst_object_unref (bus);<br>  gst_element_set_state (play, GST_STATE_PLAYING);<br>  g_timeout_add (200, (GSourceFunc) cb_print_position, play);<br>  /* now run */<br>  g_main_loop_run (loop);<br>
  /* also clean up */<br>  gst_element_set_state (play, GST_STATE_NULL);<br>  gst_object_unref (GST_OBJECT (play));<br>  return 0;<br>}<br> <br>--------------------------------- End --------------------------------<br>run:<br>
&lt;my_app&gt;  my_pipe<br><br>o/p:<br>Count 49) : Time:   0:00:09.85<br>Going to Seek for 10 sec <br>
The cur_pos 9852113000<br>new_pos = 19852112999<br>
[player] Seek failed!! <br>
Count 118) : Time:   0:00:23.63<br>
<br>--------------------------------<br>observation:<br><br><br>1) Playback successfuly between count 1- 49. <br>2) At count= 50 i.e., when seek called , the seek fails. &amp; there was no sound though player is in PLAYING state between count &lt;50 to 100&gt;<br>
3) After count = 100 , resumed normal playback.<br><br>Why there is no sound after seek failed though player was in PLAYING state.<br><br>The same behavior I observed with my own pipeline [ filesrc  ! decodebon2 ! autoaudiosink ]<br>
<br>Appreciate your input.<br><br><br>-- <br>Thanks &amp; Regards,<br><br>Satish Pattar<br><br>