Hi,

It's an interesting application that you're having in mind. Let me
make sure I understand, you want to add an english jingle before the
german adverstisement. Or, in the final version, you intend to have
one english prepending and one german one, the Advertisement tag being
put on normal tracks?

> 2009/10/26 11:55:15 [src_5619:3] Candidate to prepending not ready. Abort!
> 2009/10/26 11:55:15 [src_5619:2] #get_frame didn't add exactly one break!
> 2009/10/26 11:55:15 [threads:1] Thread "root" aborts with exception File
> "source.ml", line 212, characters 10-16: Assertion failed!
> Thread 4 killed on uncaught exception Assert_failure("source.ml", 212, 10)
> 2009/10/26 11:55:15 [main:3] Shutdown started!
> 2009/10/26 11:55:15 [root:3] Shutting down sources...
> init: exception encountered during stop phase:
>   Rqueue.Not_found

First, the crash that you're seeing is obviously a bug. It seems to me
that it's been fixed -- actually it looks like several bugs we've
worked on, one of them quite recently. Can you check with the latest
SVN version?

On my version, the following works as expected:
$ src/liquidsoap 'output.dummy(prepend(blank(duration=1.), fun (_) ->
fallback([])))'
[...]
2009/10/26 17:38:30 [src_4437:3] Candidate to prepending not ready. Abort!
2009/10/26 17:38:31 [src_4437:3] Candidate to prepending not ready. Abort!
2009/10/26 17:38:32 [src_4437:3] Candidate to prepending not ready. Abort!
2009/10/26 17:38:33 [src_4437:3] Candidate to prepending not ready. Abort!
2009/10/26 17:38:34 [src_4437:3] Candidate to prepending not ready. Abort!

Now, apart from the bug, your problem with prepend() is a common one.
You've spotted the right line in the logs: Candidate to prepending not
ready. This means that the source which should produce the track to
prepend is not ready to produce a track. We cannot wait for it, or we
would have to fail streaming.

>From the doc of prepend():
$ liquidsoap -h prepend
[...]
* (unlabeled) :: ([(string*string)])->source (default None)
    Given the metadata, build the source producing the track to
prepend. This source is allowed to fail (produce nothing) if no
relevant track is to be appended. **However, success must be
immediate.**

Now, how to ensure an immediate success: prepare things more in
advance. In your code, the single(jingleSIN) is created at prepending
time, and doesn't have time to get ready quicky:

> jingleSIN = "..."
> [...]
> def switchto(m)
>     if (m["comment"] == "Advertisment") then
>         request.queue(interactive=false, queue=[request(jingleSIN)])
>     else
>         fallback([])
>     end
> end

Just change it to the following, so the single(..) operator is created
once and for all, and will have time to get ready once and for all:
jingleSIN = single("...")
def switchto(m)
 ...
         request.queue(interactive=false, queue=[jingleSIN])
 ...
end

You should be able to change jingleSIN = single(..) to a playlist(...)
but you may have to tweak the various parameters that affect the
preparation of tracks in advance (queue_length, conservative,
default_duration). Ask here if you don't find out.

Hope that helps!
-- 
David

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to