<span class="Apple-style-span" style="border-collapse: collapse; color: rgb(32, 32, 32); font-family: &#39;Droid Sans&#39;, arial, sans-serif; font-size: 13px; "><div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(32, 32, 32); font-family: &#39;Droid Sans&#39;, arial, sans-serif; font-size: 13px; ">Found the root cause of the problem. </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(32, 32, 32); font-family: &#39;Droid Sans&#39;, arial, sans-serif; font-size: 13px; "><br></span></div><div>gst_element_get_base_time(m_pPipeline) is only updated when pipeline is put to Playing state. So, when the pipeline is in Paused state my code fails and when the pipeline is again put to Playing state base time is update and elapsed time is calculated correctly.</div>
<div><br></div><div>So, I&#39;ll have store elapsed time and only update it if in Playing state. OR implement all these things on my own. Lets see what I do in the coming weekend. </div><div><br></div><div>PS: My app can only (presently) rip audio cds. You can download latest svn snapshot from <a href="http://sparklemedia.svn.sourceforge.net/viewvc/sparklemedia/subprojects/sparklex/current-unstable/?view=tar">http://sparklemedia.svn.sourceforge.net/viewvc/sparklemedia/subprojects/sparklex/current-unstable/?view=tar</a></div>
</span><br><div class="gmail_quote">On 20 February 2011 20:16, Yogesh Marwaha <span dir="ltr">&lt;<a href="mailto:yogeshm.007@gmail.com">yogeshm.007@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I&#39;m coding a transcoding application (not using encodebin).<br>
<br>
Upto now I had been using following code to get time for which the pipeline<br>
has been in Playing state (To show user information like xx minutes/seconds<br>
the operation has run for or to calcutate averate speed and estimate remaining<br>
time etc.): -<br>
        GstClockTime elapsedTime = GST_CLOCK_TIME_NONE;<br>
        GstClock *clock = gst_element_get_clock(m_pPipeline);<br>
        if(clock)<br>
            elapsedTime = (gst_clock_get_time(clock) -<br>
gst_element_get_base_time(m_pPipeline)) / GST_SECOND;<br>
<br>
Pipeline is like this: -<br>
        gst_bin_add_many(GST_BIN(m_pPipeline), source, queue, audioConvert,<br>
audioEncoder, container, sink, NULL);<br>
<br>
But then I added code to allow pausing the operation like this: -<br>
    gst_element_set_state(m_pPipeline, GST_STATE_PAUSED);<br>
<br>
Now pipeline is paused but the clock is not. It is running always.<br>
<br>
What should I do achieve my target?<br>
<br>
Regards,<br>
<font color="#888888"><br>
Yogesh Marwaha<br>
<a href="http://sparklemedia.sourceforge.net/" target="_blank">http://sparklemedia.sourceforge.net/</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Yogesh M<br><a href="http://sparklemedia.sourceforge.net/">http://sparklemedia.sourceforge.net/</a><br><a href="http://mazedaar.wordpress.com/">http://mazedaar.wordpress.com/</a><br>
<a href="http://snakeeyes.wordpress.com/">http://snakeeyes.wordpress.com/</a><br>