On Wed, Feb 2, 2011 at 11:10 AM, Brandon Casci <[email protected]> wrote:
> I may have got it to work....

Cool. For the record, everything seems to behave as expected. Your
script is roughly like this:

a = input.harbor("foo")
b = request.dynamic({request.create("blah")})
c = fallback([a,b])
output.icecast(%vorbis,mount="foo",c)

Let's see the types:
./src/liquidsoap -c -i test.liq
a       : source(audio=2,video=0,midi=0)
b       : source(audio=2,video=0,midi=0)
c       : source(audio=2,video=0,midi=0)

The stereo type is propagated from the vorbis output to all sources.

Now let's change the last line, putting audio_to_stereo(c) instead of c:
a       : source(audio=?#A+1,video=0,midi=0)
b       : source(audio=?#A+1,video=0,midi=0)
c       : source(audio=?#A+1,video=0,midi=0)

Thanks to the conversion, not everything has to be stereo. Because of
fallback, and the input.harbor, everything under the conversion still
has to have a fixed number of channels. After typing, it is unknown
(?#A+1 means "anything fixed >=1") but before starting streaming it
has to be decided: it will be forced to 2 by default.

Instead of doing that, let's put the conversion directly above the
request source. I'll do it in two definitions so we can see the types:

a = input.harbor("foo")
b = request.dynamic({request.create("blah")})
b = audio_to_stereo(b)
c = fallback([a,b])
output.icecast(%vorbis,mount="foo",c)

./src/liquidsoap -c -i test.liq
a       : source(audio=2,video=0,midi=0)
b       : source(audio=*+1,video=0,midi=0)
b       : source(audio=2,video=0,midi=0)
c       : source(audio=2,video=0,midi=0)

We can see that stereo was propagated to most sources. But this time
nothing constrained what's under the conversion to have a fixed number
of channels. So we get a more general solution: *+1 which allows
decoding mono _and_ stereo.

Type inference may look a bit magical, but it's working for you :)
-- 
David

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to