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 126 forks source link

HLS CRASH - no EXTM3U delimiter #3284

Closed loan-talvat closed 1 year ago

loan-talvat commented 1 year ago

We are using Liquidsoap in Azuracast, and we have an issue for HLS with Liquidsoap Here is the detail of the error encountered: https://github.com/AzuraCast/AzuraCast/issues/6184

Is it possible to fix this problem?

vitoyucepi commented 1 year ago

Summary

Occasionally output.harbor.hls and output.file.hls can output incomplete files.

Reproduction

output.harbor.hls([("mp3", %mp3)], sine(), segment_duration=0.01, segments=1000)
while true;do curl -s http://localhost:8000/mp3.m3u8 | wc -l;done
2005
2005
0
2005
2005

Versions

Liquidsoap: 2.0.7, 2.1.4, 2.2.0

Install method

Container image: savonet/liquidsoap

toots commented 1 year ago

Thanks for reporting. This is addressed with https://github.com/savonet/liquidsoap/pull/3286 which I'll merge as soon as it's been properly tested.

Although this breaks the even API, I think that this is a good candidate for a rolling-release backport.

If y'all need a workround, it's possible to used a separate folder for nginx serving and use the (soon to be deprecated) "closed" event to move files when they are done writting.