2012/3/26 Max Melentiev <[email protected]>:
> Hi there!

Hi Max!

> I want to store description of the input.harbor source to pass it through
> "description" param to icecast and to export it to external file.
> I had the following code to store it in ref. But it seems that 
> rewrite_metadata
> uses only initial value of live_desc. Is there something wrong in code? But it
> seems that rewrite_metadata uses only initial value of live_desc.

In most cases, map_metadata should be used instead of
rewrite_metadata.. Let's see:

> Is there something wrong in code? Or may be there is some other simple 
> solution
> for my case?

live_desc   = ref 'qqq'
def live_on_connect( m )
   live_desc   := m[ 'ice-description' ]
   print( json_of( !live_desc ) )
end

live        = input.harbor(
   id          = "live",
   password    = hrb_pass,
   port        = hrb_port,
   on_connect  = live_on_connect,
   hrb_mp
)
live        = map_metadata( { [( "description", !live_desc )] } , live )
live        = on_metadata( (fun (m) ->
   begin
       print( json_of( m ) )
       print( json_of( !live_desc ) )
   end),
   live
)

That should do..

Now, regarding your ultimate goal, if you want to pass this to the
"description" parameter of output.icecast, this parameter is set once
and for all when connecting the source stream to your icecast server.
If you want to change it for each new harbor input, you'd also have to
create and destroy the corresponding output.icecast.. And in this
case, I don't think you need to go through the burden of passing
description using metadata..

Romain

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to