Hi Folks, I put together a quick on_demand function using some posts
from previous discussions on this list.  But I'm not sure how to get
this on_demand stream to stop and shutdown when the single track or
playlist is over.  As it is written, the request.dynamic source will
loop indefinitely and only stop with explicit call to name.stop via
the telnet interface.  Any tips from other users out there?

dyn_out = output.icecast(
  %ogg(%vorbis(quality=1)),
  host = "<ip_address>",
  port = <port>,
  password = "<passwd>",
  genre= "Mixed",
  url= "http://vinylproject.com";,
  fallible=true
)

def play_on_demand(sname)
  s=request.dynamic({request.create("/path/to/myfile.mp3")})
  # Dummy stop function
  f = ref { () }
  output = dyn_out(
      mount = (sname ^ ".ogg"),
      description = "On demand " ^ sname ^ " Liquidsoap Controller",
      name = sname ^ " Stream [ogg 1.0] - provided by liquidsoap",
      on_stop = { f = !f; f() },
      s
  )
  f := { source.shutdown(output) }
  "ok!"
end

server.register(
  namespace="ondemand",
  usage="play <stream_name>",
  description="Play URI on demand. Creates a new icecast mount to play",
  "play",
  play_on_demand
)

-- 
Chris Everest

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to