从Liquidsoap队列中清除所有文件,以安排播放列表

问题描述 投票:0回答:1

我正在使用equeue通过将曲目推入其中来播放播放列表。假设一个小时后,一个新的播放列表(文件集)被推送到队列中。不幸的是,这些曲目无法开始播放,因为它们在先前队列中的文件[[after中排队。

以下脚本从队列中删除文件:

input_fs = request.equeue(id="fs") def clear_items(s) = ret = server.execute("fs.primary_queue") ret = list.hd(ret) if ret == "" then log("Queue cleared.") (-1.) else log("There are still items in the queue, trying skip ...") source.skip(s) (0.1) end end def clear_queue(s) = add_timeout(fast=false, 0.5, {clear_items(s)}) end server.register(namespace="fs", description="Clear the all items of the filesystem queue.", usage="clear", "clear", fun (s) -> begin clear_queue(input_fs) "Done." end)

当通过Telnet调用时有效,但是还会增加一些额外的超时。结果,下一个播放列表的安排会有些延迟。

注意,我正在通过Python应用程序执行LiquidSoap调度,该应用程序使用定时线程推送到队列。

您说什么是解决此问题的推荐方法?

python telnet liquidsoap
1个回答
0
投票
我已经通过引入两个文件系统队列A和B解决了这个问题。

  1. 队列A充满播放列表项并播放
  2. 一段时间后,也会填充
  3. 队列B
  4. ,但尚未播放。播放场过渡到
  5. 队列B
  6. 并开始播放后,有足够的时间清除队列A中剩余的任何内容
© www.soinside.com 2019 - 2024. All rights reserved.