savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.39k stars 128 forks source link

request.dynamic fetch 2 files on startup. #2588

Open beauchette opened 2 years ago

beauchette commented 2 years ago

Describe the bug request.dynamic requests two files on startup. It doesn't work on 2.1.0 and 2.0.3, but it works with 1.4.3.

To Reproduce this script prints two files instead of one on startup:

set("log.file.path", "/opt/liquidsoap/liquidsoap.log")
set("server.telnet", true)
set("server.telnet.port", 1234)
set("server.telnet.bind_addr", "127.0.0.1")
set("init.daemon.pidfile.path","/opt/liquidsoap/liquidsoap.pid")

def req() =
  file = get_process_lines("/opt/liquidsoap/liquidsoap.js")
  print(file)
  result = list.hd( default = "", file)
  request.create(result)
end

s = request.dynamic(prefetch = 1, req)

security = single("/opt/liquidsoap/fallback.ogg")

radio = fallback(track_sensitive = false, [s, security])

output.icecast(%mp3(bitrate=320,id3v2=true),
  host = "localhost", port = 8000, protocol = "http",
  password = "blah", mount = "blah.mp3",
        url="blah", name="blah", description="blah",
  radio)

Expected behavior Only 1 file should be asked of my script.

Version details

Install method All versions were installed through opam

CatVahe commented 1 year ago

Hi, I have the same problem, when "prefetch" = 0 silence plays, when "prefetch" = 1 2 songs are loaded

script

!/usr/bin/liquidsoap

%include "../data.cf"

for print log

settings.log.stdout.set(true) settings.log.level.set(3) settings.log.file.path.set("#{main_dir}/#{station}/#{logs}/ Githubissues.

  • Githubissues is a development platform for aggregating issues.