Hi Stefan,<div><br></div><div>Thanks for your replay. </div><div><br></div><div>It does fail for both forward and backward.</div><div><br></div><div>Yes let me try that to add some patch to alawdec for the seek,</div><div>
<br></div><div>With Warm Regards<br>Jesu Anuroop Suresh <br><br>"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."<br>
"Anyone who has never made a mistake has never tried anything new."<br><br><br><br><br>
<br><br><div class="gmail_quote">On Mon, Oct 3, 2011 at 11:29 PM, Stefan Sauer [via GStreamer-devel] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=3869968&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
        On 09/23/2011 08:30 AM, Jesu Anuroop Suresh wrote:
<br></div><div class="im">> Hi
<br>>
<br>> Below is the pipeline
<br>>
<br>> gst-launch -v filesrc location=give_me_jesus.alaw ! audio/x-alaw,
<br>> rate=44100, channels=2 ! alawdec ! alsasink
<br>>
<br>> It fails for gst_element_seek
<br></div><div class="im">only for backward or for both? File a bug for it and ideally have a look
<br>at alwadec and see if you can make a patch.
<br><br>Stefan
<br></div><div><div><div></div><div class="h5"><div class='shrinkable-quote'><br>> Below is the code for the seek
<br>>
<br>> ff - 1 for forward, 0 for backward
<br>> time_seconds = number of seconds to seek
<br>>
<br>> This same code is working with the mp3 pipeline
<br>>
<br>> static void seekMediaTime (int ff, int time_seconds)
<br>> {
<br>> gint64 start_pos, stop_pos, rate;
<br>> gint64 start_flag, stop_flag;
<br>> gint64 pos, len, tmp = 0;
<br>> gint64 timeFf = FF_SPEED_BASE;
<br>> GstFormat fmt = GST_FORMAT_TIME;
<br>>
<br>> if (!gst_element_query_duration (recordEng.recPipeline, &fmt, &len) ||
<br>> !gst_element_query_position (recordEng.recPipeline, &fmt, &pos))
<br>> {
<br>> printf ("%s: %d Query Failed\r\n",__func__,__LINE__);
<br>> return;
<br>> }
<br>>
<br>> if (ff == 1)
<br>> {
<br>> timeFf = ((gint64)FF_SPEED_BASE * time_seconds);
<br>>
<br>> if ((len <= (pos + timeFf)) || (len == pos))
<br>> timeFf = 0;
<br>> else
<br>> tmp = pos + timeFf;
<br>> printf ("FORWARDWORD BY:%llu\r\n",timeFf);
<br>> }
<br>> else
<br>> {
<br>> timeFf = ((gint64)FF_SPEED_BASE * time_seconds);
<br>>
<br>> if ((pos <= timeFf) || (len == pos))
<br>> timeFf = 0;
<br>> else
<br>> tmp = (pos - timeFf);
<br>> printf ("BACKWORD BY:%llu\r\n",timeFf);
<br>> }
<br>> g_print ("Current Pos Time: %llu %llu\r\n",pos,len);
<br>> g_print ("Set Pos Time: %llu\r\n",tmp);
<br>> timeFf = tmp;
<br>> rate = 1.0;
<br>> start_pos = timeFf;
<br>> start_flag = GST_SEEK_TYPE_SET;
<br>> stop_flag = GST_SEEK_TYPE_NONE;
<br>> stop_pos = GST_CLOCK_TIME_NONE;
<br>>
<br>> if (!gst_element_seek (recordEng.recPipeline, rate,
<br>> GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
<br>> start_flag, start_pos,
<br>> stop_flag, stop_pos))
<br>> {
<br>> g_print ("Seek failed!\r\n");
<br>> }
<br>> else
<br>> {
<br>> g_print ("Time: %" GST_TIME_FORMAT " / %"
<br>> GST_TIME_FORMAT "\r\n",
<br>> GST_TIME_ARGS (pos), GST_TIME_ARGS (len));
<br>>
<br>> /* We will wait til it is running or failed */
<br>> if (gst_element_get_state (recordEng.recPipeline,
<br>> NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
<br>> {
<br>> g_print ("Failed to go into PLAYING state\r\n");
<br>> }
<br>> }
<br>> }
<br>>
<br>>
<br>> Regards
<br>> Jesu Anuroop Suresh
<br>>
<br>>
<br>>
<br>>
<br>>
<br>> --
<br>> View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/gst-element-seek-fails-with-alawdec-tp3835910p3835910.html" rel="nofollow" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/gst-element-seek-fails-with-alawdec-tp3835910p3835910.html</a></div>
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
<br>> _______________________________________________
<br>> gstreamer-devel mailing list
<br></div></div>> <a href="http://user/SendEmail.jtp?type=node&node=3868308&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br>> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div><br>_______________________________________________
<br>gstreamer-devel mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=3868308&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow" link="external" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://gstreamer-devel.966125.n4.nabble.com/gst-element-seek-fails-with-alawdec-tp3835910p3868308.html" target="_blank" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/gst-element-seek-fails-with-alawdec-tp3835910p3868308.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em">
                
                To unsubscribe from gst_element_seek fails with alawdec, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.
        </div></blockquote></div><br></div>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/gst-element-seek-fails-with-alawdec-tp3835910p3869968.html">Re: gst_element_seek fails with alawdec</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>