<br><br><div class="gmail_quote">2010/1/23 Tim-Philipp Müller <span dir="ltr">&lt;<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Fri, 2010-01-22 at 21:27 +0100, Pascal Ognibene wrote:<br>
<br>
Hi,<br>
<br>
&gt; I&#39;m trying to rip a CD using a simple gstreamer pipeline (..)<br>
<div class="im">&gt; In the code below, I basically use the EOS event to seek to the next<br>
&gt; cd track.<br>
&gt; But the behavior I see is weird:<br>
&gt; -the first track is ripped ok<br>
&gt; -I call the start_track_rip function for track 2<br>
&gt; -the program blocks here forever.<br>
&gt;<br>
&gt; I must be doing something really wrong but I can&#39;t see what, even by<br>
&gt; the looking at the sources of sound juicer for example.<br>
&gt; Any help is welcome,<br>
<br>
</div>Not related to your problem at all, but you might want to add a queue<br>
after cdparanoiasrc to make sure encoding continues if there are<br>
problems reading the CD (dirt on the disc etc.).<br>
<br>
I haven&#39;t actually run your code, but it looks to me like you get an EOS<br>
and then change the track number via the property and that&#39;s it.<br>
However, when you get the EOS, streaming has already stopped,<br>
cdparanoiasrc is not running any longer. At that point, setting the<br>
property will not make it start up again.<br>
<br>
You have two options here:<br>
<br>
a) set pipeline state back to READY (or NULL), then change to PLAYING<br>
again.<br>
<br>
b) issue a seek in &quot;track&quot; format (track number might be 0-based in this<br>
case, don&#39;t remember exactly) to make it start up again.<br>
<br>
(b) might work in this particular case where you&#39;re just writing mp3<br>
data to a file, but (a) is likely to work better in general, esp. with<br>
other encoders, if you add muxers or if you add a tag writer.<br>
<br>
So in short, try changing<br>
<div class="im"><br>
  gst_element_set_state(sink, GST_STATE_NULL);<br>
<br>
</div>at the beginning of start_track_rip() to<br>
<div class="im"><br>
  gst_element_set_state(pipeline, GST_STATE_NULL);</div></blockquote></div><br><br>Thank you for your help!<br><br>Actually, I stepped through the Sound Juicer code using gdb, and discovered that they destroy and recreate the pipeline for each track they rip.<br>
I&#39;ve done the same, and it works fine. I&#39;ll try your solution as well to see if i can get faster seek operations between tracks.<br>Oh, and I&#39;m going to add a queue in the middle as per your excellent suggestion - I&#39;ve been testing with a brand new CD so did not meet rip glitches yet,<br>
but this will happen for sure in &quot;real life&quot;.<br><br>Cheers,<br><br>-pog<br>