Hi there!

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. 

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        = rewrite_metadata( [( "description", !live_desc )], live )
live        = on_metadata( (fun (m) ->
    begin
        print( json_of( m ) )
        print( json_of( !live_desc ) )
    end),
    live
)

Example of output (source connected with 'test desc' description):

"test desc"
{
 "genre": "Ragga Jungle", "comment": "", "description": "qqq",
 "artist": "Gentleman", "encoder": "Liquidsoap/1.0.0 (Unix; OCaml 3.12.1)",
 "vendor": "Xiph.Org libVorbis I 20101101 (Schaufenugget)",
 "title": "Runaway[Ragga Jungle KML Remix]"
}
"test desc"



Thanks in advance.

Max.


------------------------------------------------------------------------------
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