Skip to content

Commit

Permalink
fix(hls): cast segment duration to int and bump liquidsoap
Browse files Browse the repository at this point in the history
  • Loading branch information
uZer committed Dec 13, 2024
1 parent 435802a commit 445fe3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- /conf/myradio.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-myradio
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand All @@ -36,7 +36,7 @@ services:
- /conf/myradiosurround.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-myradiosurround
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand Down Expand Up @@ -76,7 +76,7 @@ services:
- "srt://liquidsoap-myradio:10000" # voieA_caller1
container_name: source-voieA-caller1
entrypoint: []
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand All @@ -97,7 +97,7 @@ services:
- "srt://liquidsoap-myradio:10002" # voieB_caller1
container_name: source-voieB-caller1
entrypoint: []
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand All @@ -118,7 +118,7 @@ services:
- "srt://liquidsoap-myradio:10004" # override_caller1
container_name: source-override-caller1
entrypoint: []
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand All @@ -130,7 +130,7 @@ services:
- /conf/mystreamersurround.liq
- /scripts/streamer/00-live.liq
container_name: source-mystreamersurround
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand Down Expand Up @@ -158,7 +158,7 @@ services:
- "srt://liquidsoap-myradiosurround:10012" # voieB_caller1
container_name: source-ffmpegsurround
entrypoint: []
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
restart: unless-stopped
Expand Down Expand Up @@ -299,7 +299,7 @@ services:
- /conf/myradio.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-test-transcoder-stereo
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
volumes:
Expand All @@ -312,7 +312,7 @@ services:
- /conf/myradiosurround.liq
- /scripts/transcoder/00-live.liq
container_name: liquidsoap-test-transcoder-surround
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
volumes:
Expand All @@ -325,7 +325,7 @@ services:
- /conf/mystreamer.liq
- /scripts/streamer/00-live.liq
container_name: liquidsoap-test-streamer-stereo
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
volumes:
Expand All @@ -338,7 +338,7 @@ services:
- /conf/mystreamersurround.liq
- /scripts/streamer/00-live.liq
container_name: liquidsoap-test-streamer-surround
image: savonet/liquidsoap:rolling-release-v2.3.x
image: savonet/liquidsoap:v2.3.0
networks:
- default
volumes:
Expand Down
3 changes: 2 additions & 1 deletion scripts/transcoder/outputs/hls.liq
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ end

def segment_name(metadata) =
let {position, duration, extname, stream_name} = metadata
segment_duration = int_of_float(duration)
segment_timestamp = int_of_float(time())

# Add the codec to the segment name because it's expected by segment-forwarder
segment_prefix = string.replace(pattern="_", fun (_) -> "_aac_", stream_name)
"#{segment_prefix}_#{duration}_#{position}_#{segment_timestamp}.ts"
"#{segment_prefix}_#{segment_duration}_#{position}_#{segment_timestamp}.ts"
end

def on_file_change(~state, fname) =
Expand Down

0 comments on commit 445fe3f

Please sign in to comment.