<br><br><div class="gmail_quote">2010/1/23 Tim-Philipp Müller <span dir="ltr"><<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>></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>
> I'm trying to rip a CD using a simple gstreamer pipeline (..)<br>
<div class="im">> In the code below, I basically use the EOS event to seek to the next<br>
> cd track.<br>
> But the behavior I see is weird:<br>
> -the first track is ripped ok<br>
> -I call the start_track_rip function for track 2<br>
> -the program blocks here forever.<br>
><br>
> I must be doing something really wrong but I can't see what, even by<br>
> the looking at the sources of sound juicer for example.<br>
> 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'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'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 "track" format (track number might be 0-based in this<br>
case, don't remember exactly) to make it start up again.<br>
<br>
(b) might work in this particular case where you'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've done the same, and it works fine. I'll try your solution as well to see if i can get faster seek operations between tracks.<br>Oh, and I'm going to add a queue in the middle as per your excellent suggestion - I've been testing with a brand new CD so did not meet rip glitches yet,<br>
but this will happen for sure in "real life".<br><br>Cheers,<br><br>-pog<br>