On 24. nov. 2017 10:38, Stephan Hoppe wrote:
For others,

Even easier than telnetting a stream.skip on the way out is to add "track_sensitive=false" to the switch.  Then the whole thing simply becomes:

myplaylist = playlist("/home/user/playlist.m3u")
remote_stream = input.http("http://remote_stream <http://remote_stream/>")
output.dummy(fallible=true, remote_stream)
myplaylist = switch(track_sensitive=false,[ ({13h00-14h00},remote_stream), ({true}, myplaylist) ] )

This will rather unceremoniously cut whatever song is playing at 13h00, but it's better than banging your head against a wall for two days. :)
When I read the documentation for |track_sensitive|, I noticed that it says "track_sensitive (anything that is either bool or *()->bool *– defaults to true): Re-select only on end of tracks.". The "|()->bool|" thing means that |track_sensitive| can be a function (which takes no parameters and returns a boolean), which then |switch| will run periodically to get the current value for |track_sensitive|. Thus, we are actually able to make it so |track_sensitive| is |true|, /except/ at the moment we want to end the remote stream. Your script then becomes:

|myplaylist = playlist("/home/user/playlist.m3u")||
|
|remote_stream = input.http("||http://remote_stream <http://remote_stream/>||")|
|output.dummy(fallible=true, remote_stream)|
|myplaylist = switch(||track_sensitive=|*|{not 14h00}|*|,||[ ({13h00-14h00},remote_stream), ({true}, myplaylist) ] )|

That way, the song that plays at 13h00 is allowed to end before switching, while the remote stream is cut off at 14h00. I hope this helps :)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to