codemirror-lang-liquidsoap 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/liquidsoap.grammar +2 -0
- package/src/parser.js +4 -4
- package/tests/liquidsoap/.codespellignore +1 -0
- package/tests/liquidsoap/.github/ISSUE_TEMPLATE/bug_report.yml +16 -0
- package/tests/liquidsoap/.github/docker/alpine.dockerfile +20 -0
- package/tests/liquidsoap/.github/docker/debian.dockerfile +55 -0
- package/tests/liquidsoap/.github/opam/{liquidsoap-core-windows.opam → liquidsoap-windows.opam} +8 -5
- package/tests/liquidsoap/.github/renovate.json +23 -0
- package/tests/liquidsoap/.github/scripts/add-local-opam-packages.sh +5 -3
- package/tests/liquidsoap/.github/scripts/build-apk.sh +10 -19
- package/tests/liquidsoap/.github/scripts/build-deb.sh +6 -15
- package/tests/liquidsoap/.github/scripts/build-details.sh +15 -4
- package/tests/liquidsoap/.github/scripts/build-posix.sh +11 -20
- package/tests/liquidsoap/.github/scripts/build-website.sh +1 -1
- package/tests/liquidsoap/.github/scripts/build-win32.sh +6 -2
- package/tests/liquidsoap/.github/scripts/push-docker.sh +13 -15
- package/tests/liquidsoap/.github/workflows/ci.yml +291 -185
- package/tests/liquidsoap/.ocamlformat +1 -1
- package/tests/liquidsoap/.pre-commit-config.yaml +2 -2
- package/tests/liquidsoap/CHANGES.md +112 -3
- package/tests/liquidsoap/README.md +10 -9
- package/tests/liquidsoap/ROADMAP.md +14 -8
- package/tests/liquidsoap/bin/liquidsoap-macos-instruments +7 -0
- package/tests/liquidsoap/doc/content/build.md +0 -1
- package/tests/liquidsoap/doc/content/faq.md +2 -4
- package/tests/liquidsoap/doc/content/icy_metadata.md +2 -2
- package/tests/liquidsoap/doc/content/install.md +13 -2
- package/tests/liquidsoap/doc/content/json.md +1 -1
- package/tests/liquidsoap/doc/content/language.md +4 -4
- package/tests/liquidsoap/doc/content/liq/beets-protocol.liq +1 -1
- package/tests/liquidsoap/doc/content/liq/crossfade.liq +1 -1
- package/tests/liquidsoap/doc/content/liq/harbor-simple.liq +1 -1
- package/tests/liquidsoap/doc/content/liq/radiopi.liq +10 -9
- package/tests/liquidsoap/doc/content/liq/request.dynamic.liq +1 -1
- package/tests/liquidsoap/doc/content/migrating.md +25 -3
- package/tests/liquidsoap/doc/content/playlist_parsers.md +46 -1
- package/tests/liquidsoap/doc/content/script_loading.md +3 -0
- package/tests/liquidsoap/doc/content/xml.md +160 -0
- package/tests/liquidsoap/doc/dune.inc +129 -0
- package/tests/liquidsoap/dune-project +29 -49
- package/tests/liquidsoap/liquidsoap +1 -1
- package/tests/liquidsoap/{liquidsoap-js.opam → opam/liquidsoap-js.opam} +3 -2
- package/tests/liquidsoap/{liquidsoap-lang.opam → opam/liquidsoap-lang.opam} +4 -3
- package/tests/liquidsoap/{liquidsoap-mode.opam → opam/liquidsoap-mode.opam} +3 -2
- package/tests/liquidsoap/{liquidsoap-core.opam → opam/liquidsoap.opam} +46 -17
- package/tests/liquidsoap/{prometheus-liquidsoap.opam → opam/prometheus-liquidsoap.opam} +2 -1
- package/tests/liquidsoap/{sdl-liquidsoap.opam → opam/sdl-liquidsoap.opam} +2 -1
- package/tests/liquidsoap/{tls-liquidsoap.opam → opam/tls-liquidsoap.opam} +2 -1
- package/tests/liquidsoap/src/bin/dune +1 -1
- package/tests/liquidsoap/src/config/xmlplaylist_option.disabled.ml +2 -0
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_decoder.ml +22 -22
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_encoder.ml +4 -4
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_filters.ml +37 -41
- package/tests/liquidsoap/src/core/builtins/builtins_files.ml +3 -1
- package/tests/liquidsoap/src/core/builtins/builtins_optionals.ml +0 -1
- package/tests/liquidsoap/src/core/builtins/builtins_process.ml +15 -7
- package/tests/liquidsoap/src/core/builtins/builtins_resolvers.ml +16 -0
- package/tests/liquidsoap/src/core/builtins/builtins_socket.ml +7 -5
- package/tests/liquidsoap/src/core/builtins/builtins_source.ml +3 -3
- package/tests/liquidsoap/src/core/builtins/builtins_srt.ml +84 -8
- package/tests/liquidsoap/src/core/builtins/builtins_string_extra.ml +13 -0
- package/tests/liquidsoap/src/core/builtins/builtins_sys.ml +6 -6
- package/tests/liquidsoap/src/core/builtins/builtins_thread.ml +2 -2
- package/tests/liquidsoap/src/core/builtins/builtins_time.ml +5 -3
- package/tests/liquidsoap/src/core/builtins/builtins_tls.ml +1 -1
- package/tests/liquidsoap/src/core/clock.ml +105 -38
- package/tests/liquidsoap/src/core/clock.mli +1 -0
- package/tests/liquidsoap/src/core/clock_base.ml +2 -2
- package/tests/liquidsoap/src/core/conversions/stereo.ml +6 -8
- package/tests/liquidsoap/src/core/converters/audio_converter.mli +5 -5
- package/tests/liquidsoap/src/core/converters/video_converter.ml +2 -2
- package/tests/liquidsoap/src/core/converters/video_converter.mli +3 -3
- package/tests/liquidsoap/src/core/decoder/decoder.ml +14 -17
- package/tests/liquidsoap/src/core/decoder/decoder.mli +11 -11
- package/tests/liquidsoap/src/core/decoder/decoder_utils.ml +12 -13
- package/tests/liquidsoap/src/core/decoder/decoder_utils.mli +2 -3
- package/tests/liquidsoap/src/core/decoder/external_decoder.ml +9 -13
- package/tests/liquidsoap/src/core/decoder/ffmpeg_decoder.ml +57 -53
- package/tests/liquidsoap/src/core/decoder/ffmpeg_raw_decoder.ml +28 -9
- package/tests/liquidsoap/src/core/decoder/flac_metadata_plug.ml +15 -2
- package/tests/liquidsoap/src/core/decoder/image_decoder.ml +33 -19
- package/tests/liquidsoap/src/core/decoder/liq_flac_decoder.ml +22 -23
- package/tests/liquidsoap/src/core/decoder/liq_ogg_decoder.ml +5 -5
- package/tests/liquidsoap/src/core/decoder/mad_decoder.ml +2 -2
- package/tests/liquidsoap/src/core/decoder/midi_decoder.ml +1 -2
- package/tests/liquidsoap/src/core/decoder/ogg_flac_duration.ml +3 -11
- package/tests/liquidsoap/src/core/decoder/ogg_metadata_plug.ml +15 -2
- package/tests/liquidsoap/src/core/decoder/raw_audio_decoder.ml +8 -7
- package/tests/liquidsoap/src/core/decoder/wav_aiff_decoder.ml +3 -3
- package/tests/liquidsoap/src/core/dune +2 -15
- package/tests/liquidsoap/src/core/encoder/encoder.ml +18 -23
- package/tests/liquidsoap/src/core/encoder/encoder.mli +12 -17
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder.ml +13 -27
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder_common.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/encoders/flac_encoder.ml +3 -4
- package/tests/liquidsoap/src/core/encoder/encoders/ndi_encoder.ml +2 -1
- package/tests/liquidsoap/src/core/encoder/encoders/ogg_encoder.ml +1 -2
- package/tests/liquidsoap/src/core/encoder/lang/lang_external_encoder.ml +2 -2
- package/tests/liquidsoap/src/core/encoder/lang/lang_fdkaac.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/lang/lang_ffmpeg.ml +46 -39
- package/tests/liquidsoap/src/core/encoder/lang/lang_flac.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/lang/lang_shine.ml +2 -2
- package/tests/liquidsoap/src/core/encoder/lang/lang_vorbis.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/lang/lang_wav.ml +1 -1
- package/tests/liquidsoap/src/core/file_watcher.inotify.ml +8 -13
- package/tests/liquidsoap/src/core/harbor/harbor.ml +22 -24
- package/tests/liquidsoap/src/core/io/ffmpeg_filter_io.ml +4 -3
- package/tests/liquidsoap/src/core/io/oss_io.ml +3 -4
- package/tests/liquidsoap/src/core/io/portaudio_io.ml +1 -1
- package/tests/liquidsoap/src/core/io/pulseaudio_io.ml +3 -4
- package/tests/liquidsoap/src/core/io/srt_io.ml +316 -120
- package/tests/liquidsoap/src/core/io/udp_io.ml +14 -12
- package/tests/liquidsoap/src/core/lang.mli +10 -12
- package/tests/liquidsoap/src/core/lang_source.ml +25 -39
- package/tests/liquidsoap/src/core/lang_string.ml +30 -0
- package/tests/liquidsoap/src/core/lang_string.mli +3 -0
- package/tests/liquidsoap/src/core/ogg_formats/ogg_flac_encoder.ml +6 -6
- package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.ml +17 -27
- package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.mli +44 -53
- package/tests/liquidsoap/src/core/ogg_formats/opus_encoder.ml +1 -1
- package/tests/liquidsoap/src/core/ogg_formats/vorbis_encoder.ml +1 -2
- package/tests/liquidsoap/src/core/operators/add.ml +2 -2
- package/tests/liquidsoap/src/core/operators/cross.ml +2 -2
- package/tests/liquidsoap/src/core/operators/delay.ml +23 -6
- package/tests/liquidsoap/src/core/operators/dtmf.ml +3 -2
- package/tests/liquidsoap/src/core/operators/dyn_op.ml +2 -2
- package/tests/liquidsoap/src/core/operators/fir_filter.ml +2 -1
- package/tests/liquidsoap/src/core/operators/iir_filter.ml +1 -1
- package/tests/liquidsoap/src/core/operators/insert_metadata.ml +1 -1
- package/tests/liquidsoap/src/core/operators/lilv_op.ml +1 -1
- package/tests/liquidsoap/src/core/operators/lufs.ml +136 -89
- package/tests/liquidsoap/src/core/operators/lufs_c.c +105 -0
- package/tests/liquidsoap/src/core/operators/map_metadata.ml +33 -9
- package/tests/liquidsoap/src/core/operators/max_duration.ml +3 -4
- package/tests/liquidsoap/src/core/operators/muxer.ml +2 -1
- package/tests/liquidsoap/src/core/operators/noblank.ml +6 -6
- package/tests/liquidsoap/src/core/operators/sequence.ml +5 -5
- package/tests/liquidsoap/src/core/operators/switch.ml +10 -11
- package/tests/liquidsoap/src/core/operators/time_warp.ml +14 -11
- package/tests/liquidsoap/src/core/operators/video_fade.ml +2 -3
- package/tests/liquidsoap/src/core/outputs/ao_out.ml +1 -1
- package/tests/liquidsoap/src/core/outputs/bjack_out.ml +1 -1
- package/tests/liquidsoap/src/core/outputs/graphics_out.ml +6 -2
- package/tests/liquidsoap/src/core/outputs/harbor_output.ml +12 -10
- package/tests/liquidsoap/src/core/outputs/hls_output.ml +19 -14
- package/tests/liquidsoap/src/core/outputs/icecast2.ml +85 -52
- package/tests/liquidsoap/src/core/outputs/ndi_out.ml +1 -1
- package/tests/liquidsoap/src/core/outputs/output.ml +8 -9
- package/tests/liquidsoap/src/core/outputs/output.mli +61 -61
- package/tests/liquidsoap/src/core/outputs/pipe_output.ml +8 -6
- package/tests/liquidsoap/src/core/outputs/sdl_out.ml +5 -2
- package/tests/liquidsoap/src/core/playlist_parser.ml +6 -7
- package/tests/liquidsoap/src/core/playlists/playlist_basic.ml +0 -180
- package/tests/liquidsoap/src/core/protocols/annotate.ml +3 -3
- package/tests/liquidsoap/src/core/request.ml +16 -17
- package/tests/liquidsoap/src/core/request.mli +27 -28
- package/tests/liquidsoap/src/core/shebang.ml +3 -2
- package/tests/liquidsoap/src/core/source.ml +104 -63
- package/tests/liquidsoap/src/core/source.mli +249 -247
- package/tests/liquidsoap/src/core/sources/generated.ml +2 -2
- package/tests/liquidsoap/src/core/sources/request_dynamic.ml +2 -2
- package/tests/liquidsoap/src/core/sources/synthesized.ml +2 -2
- package/tests/liquidsoap/src/core/stream/aFrame.mli +7 -9
- package/tests/liquidsoap/src/core/stream/content.mli +4 -13
- package/tests/liquidsoap/src/core/stream/content_base.ml +2 -19
- package/tests/liquidsoap/src/core/stream/content_video.ml +9 -10
- package/tests/liquidsoap/src/core/stream/ffmpeg_copy_content.ml +19 -15
- package/tests/liquidsoap/src/core/stream/ffmpeg_raw_content.ml +26 -9
- package/tests/liquidsoap/src/core/stream/frame.ml +4 -4
- package/tests/liquidsoap/src/core/stream/frame.mli +13 -15
- package/tests/liquidsoap/src/core/stream/frame_base.ml +1 -2
- package/tests/liquidsoap/src/core/stream/frame_settings.ml +14 -14
- package/tests/liquidsoap/src/core/stream/generator.mli +14 -17
- package/tests/liquidsoap/src/core/stream/mFrame.mli +2 -2
- package/tests/liquidsoap/src/core/tools/charset.ml +28 -18
- package/tests/liquidsoap/src/core/tools/charset_base.ml +5 -0
- package/tests/liquidsoap/src/core/tools/child_support.ml +2 -2
- package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.ml +139 -0
- package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.mli +22 -0
- package/tests/liquidsoap/src/core/tools/ffmpeg_utils.ml +2 -1
- package/tests/liquidsoap/src/core/tools/lifecycle.mli +4 -4
- package/tests/liquidsoap/src/core/tools/liq_http.ml +44 -19
- package/tests/liquidsoap/src/core/tools/liq_http.mli +1 -1
- package/tests/liquidsoap/src/core/tools/log.ml +3 -8
- package/tests/liquidsoap/src/core/tools/log.mli +1 -1
- package/tests/liquidsoap/src/core/tools/mutex_utils.ml +1 -1
- package/tests/liquidsoap/src/core/tools/pool.ml +2 -2
- package/tests/liquidsoap/src/core/tools/process_handler.mli +30 -27
- package/tests/liquidsoap/src/core/tools/producer_consumer.ml +10 -9
- package/tests/liquidsoap/src/{lang → core/tools}/queues.ml +58 -64
- package/tests/liquidsoap/src/{lang → core/tools}/queues.mli +10 -0
- package/tests/liquidsoap/src/core/tools/sdl_utils.ml +2 -0
- package/tests/liquidsoap/src/core/tools/server.mli +8 -8
- package/tests/liquidsoap/src/core/tools/sha1.ml +2 -1
- package/tests/liquidsoap/src/core/tools/start_stop.ml +2 -1
- package/tests/liquidsoap/src/core/tools/strings.mli +5 -4
- package/tests/liquidsoap/src/core/tools/tutils.ml +7 -7
- package/tests/liquidsoap/src/core/tools/tutils.mli +14 -18
- package/tests/liquidsoap/src/core/tools/unix_c.c +16 -5
- package/tests/liquidsoap/src/core/tools/utils.ml +83 -25
- package/tests/liquidsoap/src/core/tools/wav_aiff.ml +3 -3
- package/tests/liquidsoap/src/core/tools/wav_aiff.mli +7 -7
- package/tests/liquidsoap/src/core/types/format_type.ml +6 -6
- package/tests/liquidsoap/src/js/index.html +1 -154
- package/tests/liquidsoap/src/js/interactive_js.ml +7 -3
- package/tests/liquidsoap/src/js/stdlib_js.liq +6 -0
- package/tests/liquidsoap/src/lang/builtins_lang.ml +8 -0
- package/tests/liquidsoap/src/lang/builtins_null.ml +1 -1
- package/tests/liquidsoap/src/lang/builtins_string.ml +2 -11
- package/tests/liquidsoap/src/lang/builtins_xml.ml +204 -0
- package/tests/liquidsoap/src/lang/cache.ml +7 -2
- package/tests/liquidsoap/src/lang/dune +5 -2
- package/tests/liquidsoap/src/lang/flags.ml +2 -2
- package/tests/liquidsoap/src/lang/lang.mli +10 -12
- package/tests/liquidsoap/src/lang/lang_core.ml +24 -24
- package/tests/liquidsoap/src/lang/lang_eval.ml +1 -1
- package/tests/liquidsoap/src/lang/lang_string.ml +7 -13
- package/tests/liquidsoap/src/lang/lang_string.mli +0 -1
- package/tests/liquidsoap/src/lang/lexer.ml +3 -0
- package/tests/liquidsoap/src/lang/parser.mly +7 -4
- package/tests/liquidsoap/src/lang/parser_helper.ml +9 -77
- package/tests/liquidsoap/src/lang/parser_helper.mli +1 -1
- package/tests/liquidsoap/src/lang/pos.ml +4 -4
- package/tests/liquidsoap/src/lang/pos.mli +55 -0
- package/tests/liquidsoap/src/lang/preprocessor.ml +12 -5
- package/tests/liquidsoap/src/lang/repr.ml +6 -6
- package/tests/liquidsoap/src/lang/runtime.ml +55 -48
- package/tests/liquidsoap/src/lang/runtime.mli +8 -3
- package/tests/liquidsoap/src/lang/term/parsed_term.ml +33 -33
- package/tests/liquidsoap/src/lang/term/term_base.ml +14 -10
- package/tests/liquidsoap/src/lang/term/term_preprocessor.ml +28 -1
- package/tests/liquidsoap/src/lang/term/term_reducer.ml +244 -132
- package/tests/liquidsoap/src/lang/term/term_reducer.mli +10 -2
- package/tests/liquidsoap/src/lang/term/term_stdlib.ml +14 -13
- package/tests/liquidsoap/src/lang/term.mli +3 -1
- package/tests/liquidsoap/src/lang/typechecking.ml +16 -16
- package/tests/liquidsoap/src/lang/typechecking.mli +5 -1
- package/tests/liquidsoap/src/lang/types/type_base.ml +16 -17
- package/tests/liquidsoap/src/lang/typing.ml +13 -12
- package/tests/liquidsoap/src/lang/typing.mli +2 -1
- package/tests/liquidsoap/src/lang/value.ml +20 -14
- package/tests/liquidsoap/src/libs/audio.liq +53 -18
- package/tests/liquidsoap/src/libs/autocue.liq +8 -8
- package/tests/liquidsoap/src/libs/clock.liq +3 -3
- package/tests/liquidsoap/src/libs/dune +2 -2
- package/tests/liquidsoap/src/libs/extra/audio.liq +4 -4
- package/tests/liquidsoap/src/libs/extra/audioscrobbler.liq +487 -0
- package/tests/liquidsoap/src/libs/extra/deprecations.liq +11 -11
- package/tests/liquidsoap/src/libs/extra/externals.liq +9 -9
- package/tests/liquidsoap/src/libs/extra/fades.liq +2 -2
- package/tests/liquidsoap/src/libs/extra/file.liq +1 -1
- package/tests/liquidsoap/src/libs/extra/http.liq +4 -4
- package/tests/liquidsoap/src/libs/extra/interactive.liq +1 -1
- package/tests/liquidsoap/src/libs/extra/metadata.liq +3 -3
- package/tests/liquidsoap/src/libs/extra/native.liq +6 -6
- package/tests/liquidsoap/src/libs/extra/server.liq +2 -2
- package/tests/liquidsoap/src/libs/extra/source.liq +10 -10
- package/tests/liquidsoap/src/libs/extra/spinitron.liq +11 -11
- package/tests/liquidsoap/src/libs/extra/telnet.liq +51 -0
- package/tests/liquidsoap/src/libs/extra/video.liq +2 -2
- package/tests/liquidsoap/src/libs/fades.liq +70 -57
- package/tests/liquidsoap/src/libs/ffmpeg.liq +50 -33
- package/tests/liquidsoap/src/libs/file.liq +8 -8
- package/tests/liquidsoap/src/libs/hls.liq +5 -5
- package/tests/liquidsoap/src/libs/http.liq +64 -37
- package/tests/liquidsoap/src/libs/icecast.liq +1 -1
- package/tests/liquidsoap/src/libs/io.liq +6 -6
- package/tests/liquidsoap/src/libs/medialib.liq +46 -45
- package/tests/liquidsoap/src/libs/metadata.liq +4 -4
- package/tests/liquidsoap/src/libs/null.liq +3 -3
- package/tests/liquidsoap/src/libs/playlist.liq +547 -22
- package/tests/liquidsoap/src/libs/protocols.liq +14 -14
- package/tests/liquidsoap/src/libs/replaygain.liq +11 -11
- package/tests/liquidsoap/src/libs/request.liq +27 -29
- package/tests/liquidsoap/src/libs/runtime.liq +2 -0
- package/tests/liquidsoap/src/libs/source.liq +15 -15
- package/tests/liquidsoap/src/libs/sqlite.liq +1 -1
- package/tests/liquidsoap/src/libs/stdlib.liq +1 -1
- package/tests/liquidsoap/src/libs/string.liq +6 -6
- package/tests/liquidsoap/src/libs/switches.liq +3 -3
- package/tests/liquidsoap/src/libs/thread.liq +3 -9
- package/tests/liquidsoap/src/libs/tracks.liq +23 -9
- package/tests/liquidsoap/src/libs/video.liq +32 -32
- package/tests/liquidsoap/src/modules/dtools/README.md +58 -0
- package/tests/liquidsoap/src/modules/dtools/dtools.ml +19 -0
- package/tests/liquidsoap/src/modules/dtools/dtools.mli +284 -0
- package/tests/liquidsoap/src/modules/dtools/dtools_impl.ml +860 -0
- package/tests/liquidsoap/src/modules/dtools/dtools_syslog.impl.ml +45 -0
- package/tests/liquidsoap/src/modules/dtools/dtools_syslog.noop.ml +1 -0
- package/tests/liquidsoap/src/modules/dtools/dune +12 -0
- package/tests/liquidsoap/src/modules/duppy/.merlin +4 -0
- package/tests/liquidsoap/src/modules/duppy/README.md +47 -0
- package/tests/liquidsoap/src/modules/duppy/dune +7 -0
- package/tests/liquidsoap/src/modules/duppy/duppy.ml +1097 -0
- package/tests/liquidsoap/src/modules/duppy/duppy.mli +494 -0
- package/tests/liquidsoap/src/modules/duppy/duppy_stubs.c +176 -0
- package/tests/liquidsoap/src/modules/duppy/examples/dune +9 -0
- package/tests/liquidsoap/src/modules/duppy/examples/http.ml +560 -0
- package/tests/liquidsoap/src/modules/duppy/examples/index.html +1 -0
- package/tests/liquidsoap/src/modules/duppy/examples/telnet.ml +150 -0
- package/tests/liquidsoap/src/modules/xmlplaylist/dune +5 -0
- package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.ml +185 -0
- package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.mli +56 -0
- package/tests/liquidsoap/src/ndi/ndi.mli +2 -3
- package/tests/liquidsoap/src/runtime/build_config.ml +0 -1
- package/tests/liquidsoap/src/runtime/main.ml +4 -23
- package/tests/liquidsoap/src/stereotool/stereotool.mli +3 -3
- package/tests/liquidsoap/src/tooling/parsed_json.ml +6 -4
- package/tests/liquidsoap/tests/core/content_test.ml +2 -39
- package/tests/liquidsoap/tests/core/dune +13 -0
- package/tests/liquidsoap/tests/core/dune.inc +1 -1
- package/tests/liquidsoap/tests/core/gen_dune.ml +4 -1
- package/tests/liquidsoap/tests/core/json_test.ml +10 -0
- package/tests/liquidsoap/tests/core/more_types.ml +32 -28
- package/tests/liquidsoap/tests/core/output_encoded_test.ml +2 -0
- package/tests/liquidsoap/tests/core/string_test.ml +4 -0
- package/tests/liquidsoap/tests/core/types.ml +1 -1
- package/tests/liquidsoap/tests/harbor/http.liq +1 -1
- package/tests/liquidsoap/tests/harbor/http2.liq +1 -1
- package/tests/liquidsoap/tests/language/cue_test.liq +3993 -0
- package/tests/liquidsoap/tests/language/dune.inc +24 -0
- package/tests/liquidsoap/tests/language/error.liq +1 -1
- package/tests/liquidsoap/tests/language/json.liq +11 -11
- package/tests/liquidsoap/tests/language/list.liq +1 -1
- package/tests/liquidsoap/tests/language/metadata.liq +1 -1
- package/tests/liquidsoap/tests/language/null.liq +9 -9
- package/tests/liquidsoap/tests/language/record.liq +23 -23
- package/tests/liquidsoap/tests/language/replaygain.liq +8 -8
- package/tests/liquidsoap/tests/language/sqlite.liq +1 -1
- package/tests/liquidsoap/tests/language/string.liq +1 -1
- package/tests/liquidsoap/tests/language/type_errors.liq +2 -2
- package/tests/liquidsoap/tests/language/typing.liq +2 -2
- package/tests/liquidsoap/tests/language/various.liq +1 -0
- package/tests/liquidsoap/tests/language/xml_test.liq +132 -0
- package/tests/liquidsoap/tests/media/dune +74 -0
- package/tests/liquidsoap/tests/media/dune.inc +63 -0
- package/tests/liquidsoap/tests/media/ffmpeg_add_text.liq +42 -56
- package/tests/liquidsoap/tests/media/ffmpeg_copy_concat.liq +5 -2
- package/tests/liquidsoap/tests/media/ffmpeg_distributed_hls.liq +2 -4
- package/tests/liquidsoap/tests/media/ffmpeg_filter_changing_rate.liq +1 -1
- package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_audio.liq +1 -5
- package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_video.liq +1 -3
- package/tests/liquidsoap/tests/media/ffmpeg_raw_and_encode_decoder.liq +1 -3
- package/tests/liquidsoap/tests/media/ffmpeg_raw_hls.liq +2 -4
- package/tests/liquidsoap/tests/media/ffmpeg_raw_implicit_conversion.liq +63 -0
- package/tests/liquidsoap/tests/media/gen_dune.ml +1 -0
- package/tests/liquidsoap/tests/media/image_decoder_duration.liq +15 -0
- package/tests/liquidsoap/tests/media/lufs_integrated.liq +17 -0
- package/tests/liquidsoap/tests/regression/AC5109.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH1129.liq +3 -3
- package/tests/liquidsoap/tests/regression/GH1279.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH1327.liq +3 -3
- package/tests/liquidsoap/tests/regression/GH2585.liq +0 -2
- package/tests/liquidsoap/tests/regression/GH2756-2.liq +3 -3
- package/tests/liquidsoap/tests/regression/GH2756.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH3134.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH3303.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH4163.liq +14 -3
- package/tests/liquidsoap/tests/regression/GH4281-2.liq +29 -0
- package/tests/liquidsoap/tests/regression/GH4281.liq +29 -0
- package/tests/liquidsoap/tests/regression/GH4395.liq +27 -0
- package/tests/liquidsoap/tests/regression/LS354-1.liq +1 -1
- package/tests/liquidsoap/tests/regression/LS354-2.liq +1 -1
- package/tests/liquidsoap/tests/regression/append-merge.liq +3 -1
- package/tests/liquidsoap/tests/regression/dune.inc +64 -0
- package/tests/liquidsoap/tests/regression/fallible_ogg.liq +9 -0
- package/tests/liquidsoap/tests/regression/init-error.liq +2 -0
- package/tests/liquidsoap/tests/regression/seek_track_map.liq +1 -1
- package/tests/liquidsoap/tests/regression/source_dynamic.liq +2 -2
- package/tests/liquidsoap/tests/run_test.ml +53 -60
- package/tests/liquidsoap/tests/streams/cross-override-end.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-override-start.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-persist-end-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-persist-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-persist-start-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross.liq +8 -2
- package/tests/liquidsoap/tests/streams/crossfade-plot.liq +11 -8
- package/tests/liquidsoap/tests/streams/crossfade-plot.new.txt +148 -248
- package/tests/liquidsoap/tests/streams/crossfade-plot.old.txt +50 -150
- package/tests/liquidsoap/tests/streams/crossfade.liq +8 -2
- package/tests/liquidsoap/tests/streams/ctype2.liq +1 -1
- package/tests/liquidsoap/tests/streams/dune.inc +31 -0
- package/tests/liquidsoap/tests/streams/fades-overrides.liq +9 -2
- package/tests/liquidsoap/tests/streams/fades-persistent-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/harbor_metadata_3.liq +1 -1
- package/tests/liquidsoap/tests/streams/hls_id3v2.liq +11 -7
- package/tests/liquidsoap/tests/streams/icecast_last_meta.liq +47 -0
- package/tests/liquidsoap/tests/streams/icecast_ssl.liq +3 -0
- package/tests/liquidsoap/tests/streams/icecast_ssl_tls.liq +3 -3
- package/tests/liquidsoap/tests/streams/icecast_tls.liq +1 -0
- package/tests/liquidsoap/tests/streams/icecast_tls_ssl.liq +5 -0
- package/tests/liquidsoap/tests/streams/no-cue-cut.liq +2 -2
- package/tests/liquidsoap/tests/streams/random.liq +2 -2
- package/tests/liquidsoap/tests/streams/replaygain.liq +10 -10
- package/tests/liquidsoap/tests/streams/rotate.liq +6 -1
- package/tests/liquidsoap/tests/streams/say.liq +2 -2
- package/tests/liquidsoap/tests/streams/srt_listen_callback.liq +1 -0
- package/tests/liquidsoap/tests/streams/srt_multiple_outputs.liq +1 -0
- package/tests/liquidsoap/tests/streams/srt_passphrase.liq +1 -0
- package/tests/liquidsoap/tests/streams/srt_raw_pcm.liq +1 -0
- package/tests/liquidsoap/tests/test.liq +4 -5
- package/tests/liquidsoap/.github/docker/Dockerfile.production +0 -37
- package/tests/liquidsoap/.github/docker/Dockerfile.production-alpine +0 -18
- package/tests/liquidsoap/.github/opam/packages/metadata/metadata.0.3.0/opam +0 -33
- package/tests/liquidsoap/.github/scripts/build-docker-alpine.sh +0 -31
- package/tests/liquidsoap/.github/scripts/build-docker.sh +0 -35
- package/tests/liquidsoap/liquidsoap-libs-extra.opam +0 -32
- package/tests/liquidsoap/liquidsoap-libs.opam +0 -31
- package/tests/liquidsoap/liquidsoap.opam +0 -63
- package/tests/liquidsoap/src/core/builtins/builtins_lastfm.ml +0 -110
- package/tests/liquidsoap/src/core/tools/liqfm.ml +0 -244
- package/tests/liquidsoap/src/libs/extra/lastfm.liq +0 -185
- /package/tests/liquidsoap/.github/docker/{Dockerfile.website → website.dockerfile} +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-av-windows/{ffmpeg-av-windows.1.2.0 → ffmpeg-av-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avcodec-windows/{ffmpeg-avcodec-windows.1.2.0 → ffmpeg-avcodec-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avdevice-windows/{ffmpeg-avdevice-windows.1.2.0 → ffmpeg-avdevice-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avfilter-windows/{ffmpeg-avfilter-windows.1.2.0 → ffmpeg-avfilter-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avutil-windows/{ffmpeg-avutil-windows.1.2.0 → ffmpeg-avutil-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swresample-windows/{ffmpeg-swresample-windows.1.2.0 → ffmpeg-swresample-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swscale-windows/{ffmpeg-swscale-windows.1.2.0 → ffmpeg-swscale-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-windows/{ffmpeg-windows.1.2.0 → ffmpeg-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/{liquidsoap-mode.opam.template → opam/liquidsoap-mode.opam.template} +0 -0
- /package/tests/liquidsoap/{liquidsoap.opam.template → opam/liquidsoap.opam.template} +0 -0
|
@@ -23,17 +23,16 @@
|
|
|
23
23
|
open Mm
|
|
24
24
|
|
|
25
25
|
(** Create a buffer between two clocks.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* that the buffer will empty). *)
|
|
26
|
+
|
|
27
|
+
This creates an active operator in the inner clock (the action consists in
|
|
28
|
+
filling the buffer) but it does not create or force in any way the clock
|
|
29
|
+
that's going to animate it.
|
|
30
|
+
|
|
31
|
+
We actually create two sources, to avoid the mess of having a same source
|
|
32
|
+
belonging to one clock but being animated by another. This makes it possible
|
|
33
|
+
to have the inner clock stop and shutdown the source that feeds the buffer,
|
|
34
|
+
without disturbing the other clock in which the buffer-consumer will still
|
|
35
|
+
behave OK (except obviously that the buffer will empty). *)
|
|
37
36
|
module Buffer = struct
|
|
38
37
|
(* The kind of value shared by a producer and a consumer. *)
|
|
39
38
|
type control = {
|
|
@@ -86,6 +85,7 @@ module Buffer = struct
|
|
|
86
85
|
~max_buffer source_val c =
|
|
87
86
|
let prebuf = Frame.main_of_seconds pre_buffer in
|
|
88
87
|
let maxbuf = Frame.main_of_seconds max_buffer in
|
|
88
|
+
let source = Lang.to_source source_val in
|
|
89
89
|
object
|
|
90
90
|
inherit
|
|
91
91
|
Output.output
|
|
@@ -95,6 +95,7 @@ module Buffer = struct
|
|
|
95
95
|
method! reset = ()
|
|
96
96
|
method start = ()
|
|
97
97
|
method stop = ()
|
|
98
|
+
method self_sync = source#self_sync
|
|
98
99
|
val source = Lang.to_source source_val
|
|
99
100
|
|
|
100
101
|
method send_frame frame =
|
|
@@ -362,6 +363,7 @@ module AdaptativeBuffer = struct
|
|
|
362
363
|
class consumer ~autostart ~infallible ~on_start ~on_stop ~pre_buffer ~reset
|
|
363
364
|
source_val c =
|
|
364
365
|
let prebuf = Frame.audio_of_seconds pre_buffer in
|
|
366
|
+
let source = Lang.to_source source_val in
|
|
365
367
|
object (self)
|
|
366
368
|
inherit
|
|
367
369
|
Output.output
|
|
@@ -372,6 +374,7 @@ module AdaptativeBuffer = struct
|
|
|
372
374
|
method! reset = ()
|
|
373
375
|
method start = ()
|
|
374
376
|
method stop = ()
|
|
377
|
+
method self_sync = source#self_sync
|
|
375
378
|
val source = Lang.to_source source_val
|
|
376
379
|
|
|
377
380
|
method send_frame frame =
|
|
@@ -25,8 +25,7 @@ open Source
|
|
|
25
25
|
|
|
26
26
|
let video_fade = Lang.add_module ~base:Modules.video "fade"
|
|
27
27
|
|
|
28
|
-
(** Fade-in at the beginning of every track.
|
|
29
|
-
* The [duration] is in seconds. *)
|
|
28
|
+
(** Fade-in at the beginning of every track. The [duration] is in seconds. *)
|
|
30
29
|
class fade_in ?(meta = "liq_video_fade_in") duration fader fadefun source =
|
|
31
30
|
object (self)
|
|
32
31
|
inherit operator ~name:"video.fade.in" [source]
|
|
@@ -251,7 +250,7 @@ let extract p =
|
|
|
251
250
|
(* A few typical shapes..
|
|
252
251
|
* In theory, any mapping from [0:1] to [0:1] is OK,
|
|
253
252
|
* preferably monotonic and one-to-one. *)
|
|
254
|
-
|
|
253
|
+
match Lang.to_string mode with
|
|
255
254
|
| "lin" -> fun x -> x
|
|
256
255
|
| "log" ->
|
|
257
256
|
let curve = 10. in
|
|
@@ -44,7 +44,7 @@ class output ~self_sync ~driver ~register_telnet ~infallible ~on_start ~on_stop
|
|
|
44
44
|
|
|
45
45
|
val mutable device = None
|
|
46
46
|
|
|
47
|
-
method
|
|
47
|
+
method self_sync =
|
|
48
48
|
if self_sync then
|
|
49
49
|
(`Dynamic, if device <> None then Some sync_source else None)
|
|
50
50
|
else (`Static, None)
|
|
@@ -37,7 +37,7 @@ class output ~self_sync ~infallible ~register_telnet ~on_stop ~on_start ~server
|
|
|
37
37
|
|
|
38
38
|
val mutable device = None
|
|
39
39
|
|
|
40
|
-
method
|
|
40
|
+
method self_sync =
|
|
41
41
|
if self_sync then
|
|
42
42
|
(`Dynamic, if device <> None then Some Bjack_in.sync_source else None)
|
|
43
43
|
else (`Static, None)
|
|
@@ -21,12 +21,14 @@
|
|
|
21
21
|
|
|
22
22
|
open Mm
|
|
23
23
|
|
|
24
|
-
class output ~infallible ~register_telnet ~autostart ~on_start ~on_stop
|
|
24
|
+
class output ~infallible ~register_telnet ~autostart ~on_start ~on_stop
|
|
25
|
+
source_val =
|
|
26
|
+
let source = Lang.to_source source_val in
|
|
25
27
|
object (self)
|
|
26
28
|
inherit
|
|
27
29
|
Output.output
|
|
28
30
|
~name:"graphics" ~output_kind:"output.graphics" ~infallible
|
|
29
|
-
~register_telnet ~on_start ~on_stop
|
|
31
|
+
~register_telnet ~on_start ~on_stop source_val autostart
|
|
30
32
|
|
|
31
33
|
val mutable sleep = false
|
|
32
34
|
method stop = sleep <- true
|
|
@@ -38,6 +40,8 @@ class output ~infallible ~register_telnet ~autostart ~on_start ~on_stop source =
|
|
|
38
40
|
Graphics.resize_window width height;
|
|
39
41
|
sleep <- false
|
|
40
42
|
|
|
43
|
+
method self_sync = source#self_sync
|
|
44
|
+
|
|
41
45
|
method send_frame buf =
|
|
42
46
|
match (VFrame.data buf).Content.Video.data with
|
|
43
47
|
| [] -> ()
|
|
@@ -61,12 +61,12 @@ module M = Icecast_utils.Icecast_v (Icecast)
|
|
|
61
61
|
open M
|
|
62
62
|
|
|
63
63
|
(* Max total length for ICY metadata is 255*16
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
Format is: "StreamTitle='%s';StreamUrl='%s'"
|
|
65
|
+
"StreamTitle='';"; is 15 chars long, "StreamUrl='';"
|
|
66
|
+
is 13 chars long, leaving 4052 chars remaining.
|
|
67
|
+
Splitting those in:
|
|
68
|
+
max title length = 3852
|
|
69
|
+
max url length = 200 *)
|
|
70
70
|
let max_title = 3852
|
|
71
71
|
let max_url = 200
|
|
72
72
|
|
|
@@ -297,8 +297,8 @@ let client_task c =
|
|
|
297
297
|
();
|
|
298
298
|
Duppy.Monad.catch (client_task c) (fun _ -> Duppy.Monad.raise ())
|
|
299
299
|
|
|
300
|
-
(** Sending encoded data to a shout-compatible server.
|
|
301
|
-
|
|
300
|
+
(** Sending encoded data to a shout-compatible server. It directly takes the
|
|
301
|
+
Lang param list and extracts stuff from it. *)
|
|
302
302
|
class output p =
|
|
303
303
|
let pos = Lang.pos p in
|
|
304
304
|
let e f v = f (List.assoc v p) in
|
|
@@ -346,7 +346,8 @@ class output p =
|
|
|
346
346
|
(List.assoc "buffer" p, "Maximum buffering inferior to burst length"))
|
|
347
347
|
else ()
|
|
348
348
|
in
|
|
349
|
-
let
|
|
349
|
+
let source_val = Lang.assoc "" 2 p in
|
|
350
|
+
let source = Lang.to_source source_val in
|
|
350
351
|
let mount = s "mount" in
|
|
351
352
|
let uri =
|
|
352
353
|
match mount.[0] with '/' -> mount | _ -> Printf.sprintf "%c%s" '/' mount
|
|
@@ -419,7 +420,7 @@ class output p =
|
|
|
419
420
|
inherit
|
|
420
421
|
[Strings.t] Output.encoded
|
|
421
422
|
~output_kind:"output.harbor" ~infallible ~register_telnet ~autostart
|
|
422
|
-
~export_cover_metadata:false ~on_start ~on_stop ~name:mount
|
|
423
|
+
~export_cover_metadata:false ~on_start ~on_stop ~name:mount source_val
|
|
423
424
|
|
|
424
425
|
val mutable dump = None
|
|
425
426
|
val mutable encoder = None
|
|
@@ -431,6 +432,7 @@ class output p =
|
|
|
431
432
|
val burst_data = Strings.Mutable.empty ()
|
|
432
433
|
val metadata = { metadata = None; metadata_m = Mutex.create () }
|
|
433
434
|
method encode frame = (Option.get encoder).Encoder.encode frame
|
|
435
|
+
method self_sync = source#self_sync
|
|
434
436
|
|
|
435
437
|
method insert_metadata m =
|
|
436
438
|
let m = Frame.Metadata.Export.to_metadata m in
|
|
@@ -318,7 +318,8 @@ type metadata =
|
|
|
318
318
|
|
|
319
319
|
let pending_metadata = function `Todo _ -> true | _ -> false
|
|
320
320
|
|
|
321
|
-
(** A stream in the HLS (which typically contains many, with different
|
|
321
|
+
(** A stream in the HLS (which typically contains many, with different
|
|
322
|
+
qualities). *)
|
|
322
323
|
type stream = {
|
|
323
324
|
name : string;
|
|
324
325
|
format : Encoder.format;
|
|
@@ -436,15 +437,15 @@ class hls_output p =
|
|
|
436
437
|
Filename.concat hls_directory filename
|
|
437
438
|
else filename
|
|
438
439
|
in
|
|
439
|
-
|
|
440
|
-
(try Utils.mkdir ~perm:dir_perm dir
|
|
440
|
+
(try Utils.ensure_dir ~perm:dir_perm filename
|
|
441
441
|
with exn ->
|
|
442
442
|
raise
|
|
443
443
|
(Error.Invalid_value
|
|
444
444
|
( List.assoc "persist_at" p,
|
|
445
445
|
Printf.sprintf
|
|
446
|
-
"Error while creating directory
|
|
447
|
-
|
|
446
|
+
"Error while creating directory for persisting state at \
|
|
447
|
+
%s: %s"
|
|
448
|
+
(Lang_string.quote_string filename)
|
|
448
449
|
(Printexc.to_string exn) )));
|
|
449
450
|
filename)
|
|
450
451
|
(Lang.to_option (List.assoc "persist_at" p))
|
|
@@ -619,7 +620,8 @@ class hls_output p =
|
|
|
619
620
|
then 7
|
|
620
621
|
else 3)
|
|
621
622
|
in
|
|
622
|
-
let
|
|
623
|
+
let source_val = Lang.assoc "" 3 p in
|
|
624
|
+
let source = Lang.to_source source_val in
|
|
623
625
|
let main_playlist_filename = Lang.to_string (List.assoc "playlist" p) in
|
|
624
626
|
let main_playlist_extra_tags =
|
|
625
627
|
List.map
|
|
@@ -640,7 +642,7 @@ class hls_output p =
|
|
|
640
642
|
[(int * Strings.t option * Strings.t) list] Output.encoded
|
|
641
643
|
~infallible ~register_telnet ~on_start ~on_stop ~autostart
|
|
642
644
|
~export_cover_metadata:false ~output_kind:"output.file"
|
|
643
|
-
~name:main_playlist_filename
|
|
645
|
+
~name:main_playlist_filename source_val
|
|
644
646
|
|
|
645
647
|
(** Available segments *)
|
|
646
648
|
val mutable segments = List.map (fun { name } -> (name, ref [])) streams
|
|
@@ -649,6 +651,7 @@ class hls_output p =
|
|
|
649
651
|
method streams = streams
|
|
650
652
|
val mutable current_position = (0, 0)
|
|
651
653
|
val mutable state : hls_state = `Idle
|
|
654
|
+
method self_sync = source#self_sync
|
|
652
655
|
|
|
653
656
|
method private toggle_state event =
|
|
654
657
|
match (event, state) with
|
|
@@ -696,6 +699,7 @@ class hls_output p =
|
|
|
696
699
|
~finally:(fun () -> try Sys.remove tmp_file with _ -> ())
|
|
697
700
|
(fun () ->
|
|
698
701
|
let fname = Filename.concat hls_directory (filename ()) in
|
|
702
|
+
Utils.ensure_dir ~perm:dir_perm fname;
|
|
699
703
|
saved_filename <- Some fname;
|
|
700
704
|
let state =
|
|
701
705
|
if Sys.file_exists fname then `Updated else `Created
|
|
@@ -1079,21 +1083,22 @@ class hls_output p =
|
|
|
1079
1083
|
if segment.len + len > segment_main_duration then
|
|
1080
1084
|
( true,
|
|
1081
1085
|
Printf.sprintf
|
|
1082
|
-
"Terminating current segment on stream %s to make expected
|
|
1083
|
-
|
|
1086
|
+
"Terminating current segment %d on stream %s to make expected \
|
|
1087
|
+
length"
|
|
1088
|
+
segment.id s.name,
|
|
1084
1089
|
true )
|
|
1085
1090
|
else if s.id3_enabled && pending_metadata s.metadata then
|
|
1086
1091
|
( true,
|
|
1087
1092
|
Printf.sprintf
|
|
1088
|
-
"Terminating current segment on stream %s to insert new metadata"
|
|
1089
|
-
s.name,
|
|
1093
|
+
"Terminating current segment %d on stream %s to insert new metadata"
|
|
1094
|
+
segment.id s.name,
|
|
1090
1095
|
false )
|
|
1091
1096
|
else if Atomic.get s.pending_extra_tags <> [] then
|
|
1092
1097
|
( true,
|
|
1093
1098
|
Printf.sprintf
|
|
1094
|
-
"Terminating current segment on stream %s to insert pending
|
|
1095
|
-
tags"
|
|
1096
|
-
s.name,
|
|
1099
|
+
"Terminating current segment %d on stream %s to insert pending \
|
|
1100
|
+
extra tags"
|
|
1101
|
+
segment.id s.name,
|
|
1097
1102
|
false )
|
|
1098
1103
|
else (false, "", false)
|
|
1099
1104
|
|
|
@@ -24,6 +24,16 @@
|
|
|
24
24
|
|
|
25
25
|
module Http = Liq_http
|
|
26
26
|
|
|
27
|
+
let conf_icecast =
|
|
28
|
+
Dtools.Conf.void ~p:(Configure.conf#plug "icecast") "Icecast configuration"
|
|
29
|
+
|
|
30
|
+
let conf_prefer_address =
|
|
31
|
+
Dtools.Conf.string
|
|
32
|
+
~p:(conf_icecast#plug "prefer_address")
|
|
33
|
+
~d:"system"
|
|
34
|
+
"Set preference for resolving addresses. One of: `\"system\"`, `\"ipv4\"` \
|
|
35
|
+
or `\"ipv6\"`."
|
|
36
|
+
|
|
27
37
|
let error_translator = function
|
|
28
38
|
| Cry.Error _ as e -> Some (Cry.string_of_error e)
|
|
29
39
|
| _ -> None
|
|
@@ -135,12 +145,12 @@ module Icecast = struct
|
|
|
135
145
|
match audio with
|
|
136
146
|
| Some
|
|
137
147
|
(Ogg_format.Vorbis
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
{
|
|
149
|
+
Vorbis_format.channels = n;
|
|
150
|
+
mode = Vorbis_format.VBR q;
|
|
151
|
+
samplerate = s;
|
|
152
|
+
_;
|
|
153
|
+
}) ->
|
|
144
154
|
{
|
|
145
155
|
quality = Some (string_of_float q);
|
|
146
156
|
bitrate = None;
|
|
@@ -149,12 +159,12 @@ module Icecast = struct
|
|
|
149
159
|
}
|
|
150
160
|
| Some
|
|
151
161
|
(Ogg_format.Vorbis
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
162
|
+
{
|
|
163
|
+
Vorbis_format.channels = n;
|
|
164
|
+
mode = Vorbis_format.ABR (_, b, _);
|
|
165
|
+
samplerate = s;
|
|
166
|
+
_;
|
|
167
|
+
}) ->
|
|
158
168
|
{
|
|
159
169
|
quality = None;
|
|
160
170
|
bitrate = b;
|
|
@@ -163,12 +173,12 @@ module Icecast = struct
|
|
|
163
173
|
}
|
|
164
174
|
| Some
|
|
165
175
|
(Ogg_format.Vorbis
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
{
|
|
177
|
+
Vorbis_format.channels = n;
|
|
178
|
+
mode = Vorbis_format.CBR b;
|
|
179
|
+
samplerate = s;
|
|
180
|
+
_;
|
|
181
|
+
}) ->
|
|
172
182
|
{
|
|
173
183
|
quality = None;
|
|
174
184
|
bitrate = Some b;
|
|
@@ -202,7 +212,7 @@ let default_icy_song =
|
|
|
202
212
|
elsif title != "" then
|
|
203
213
|
title
|
|
204
214
|
else
|
|
205
|
-
null
|
|
215
|
+
null
|
|
206
216
|
end
|
|
207
217
|
end|}
|
|
208
218
|
|
|
@@ -219,8 +229,9 @@ let proto frame_t =
|
|
|
219
229
|
Lang.nullable_t Lang.string_t,
|
|
220
230
|
Some Lang.null,
|
|
221
231
|
Some
|
|
222
|
-
"Preferred address type when resolving hostnames. One of:
|
|
223
|
-
or `\"ipv6\"`. Defaults to
|
|
232
|
+
"Preferred address type when resolving hostnames. One of: \
|
|
233
|
+
`\"system\"`, `\"ipv4\"` or `\"ipv6\"`. Defaults to \
|
|
234
|
+
`settings.icecast.prefer_address` when `null`." );
|
|
224
235
|
( "transport",
|
|
225
236
|
Lang.http_transport_base_t,
|
|
226
237
|
Some (Lang.base_http_transport Http.unix_transport),
|
|
@@ -234,6 +245,12 @@ let proto frame_t =
|
|
|
234
245
|
Some
|
|
235
246
|
"Timeout for establishing network connections (disabled is negative)."
|
|
236
247
|
);
|
|
248
|
+
( "send_last_metadata_on_connect",
|
|
249
|
+
Lang.bool_t,
|
|
250
|
+
Some (Lang.bool true),
|
|
251
|
+
Some
|
|
252
|
+
"Send the source's last metadata when connecting to the remote \
|
|
253
|
+
icecast server." );
|
|
237
254
|
( "timeout",
|
|
238
255
|
Lang.float_t,
|
|
239
256
|
Some (Lang.float 30.),
|
|
@@ -326,8 +343,8 @@ let proto frame_t =
|
|
|
326
343
|
("", Lang.source_t frame_t, None, None);
|
|
327
344
|
]
|
|
328
345
|
|
|
329
|
-
(** Sending encoded data to a shout-compatible server.
|
|
330
|
-
|
|
346
|
+
(** Sending encoded data to a shout-compatible server. It directly takes the
|
|
347
|
+
Lang param list and extracts stuff from it. *)
|
|
331
348
|
class output p =
|
|
332
349
|
let e f v = f (List.assoc v p) in
|
|
333
350
|
let s v = e Lang.to_string v in
|
|
@@ -341,6 +358,9 @@ class output p =
|
|
|
341
358
|
let msg = Printexc.to_string error in
|
|
342
359
|
Lang.to_float (Lang.apply on_error [("", Lang.string msg)])
|
|
343
360
|
in
|
|
361
|
+
let send_last_metadata_on_connect =
|
|
362
|
+
e Lang.to_bool "send_last_metadata_on_connect"
|
|
363
|
+
in
|
|
344
364
|
let data = encoder_data p in
|
|
345
365
|
let chunked = Lang.to_bool (List.assoc "chunked" p) in
|
|
346
366
|
let protocol =
|
|
@@ -396,7 +416,8 @@ class output p =
|
|
|
396
416
|
| None | Some "" -> Charset.utf8
|
|
397
417
|
| Some s -> Charset.of_string s
|
|
398
418
|
in
|
|
399
|
-
let
|
|
419
|
+
let source_val = Lang.assoc "" 2 p in
|
|
420
|
+
let source = Lang.to_source source_val in
|
|
400
421
|
let icy_id = Lang.to_int (List.assoc "icy_id" p) in
|
|
401
422
|
let mount = s "mount" in
|
|
402
423
|
let name =
|
|
@@ -426,12 +447,17 @@ class output p =
|
|
|
426
447
|
let transport = e Lang.to_http_transport "transport" in
|
|
427
448
|
let prefer_address =
|
|
428
449
|
let v = List.assoc "prefer_address" p in
|
|
429
|
-
match
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
|
434
|
-
|
|
450
|
+
match
|
|
451
|
+
Option.value ~default:conf_prefer_address#get
|
|
452
|
+
(Lang.to_valued_option Lang.to_string v)
|
|
453
|
+
with
|
|
454
|
+
| "system" -> `System_default
|
|
455
|
+
| "ipv4" -> `Ipv4
|
|
456
|
+
| "ipv6" -> `Ipv6
|
|
457
|
+
| _ ->
|
|
458
|
+
raise
|
|
459
|
+
(Error.Invalid_value
|
|
460
|
+
(v, "Valid values are: `\"system\"`, `\"ipv4\"` or `\"ipv6\"`."))
|
|
435
461
|
in
|
|
436
462
|
let transport = (transport :> Cry.transport) in
|
|
437
463
|
let transport =
|
|
@@ -479,18 +505,16 @@ class output p =
|
|
|
479
505
|
inherit
|
|
480
506
|
[Strings.t] Output.encoded
|
|
481
507
|
~output_kind:"output.icecast" ~infallible ~register_telnet ~autostart
|
|
482
|
-
~export_cover_metadata:false ~on_start ~on_stop ~name
|
|
483
|
-
|
|
484
|
-
(** In this operator, we don't exactly follow the start/stop
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
* going, and the sending will keep being attempted, which
|
|
493
|
-
* will at some point trigger a restart. *)
|
|
508
|
+
~export_cover_metadata:false ~on_start ~on_stop ~name source_val
|
|
509
|
+
|
|
510
|
+
(** In this operator, we don't exactly follow the start/stop mechanism of
|
|
511
|
+
Output.encoded because we want to control in a more subtle way the
|
|
512
|
+
connection/disconnection with icecast. So we have specific
|
|
513
|
+
icecast_start/stop procedures that only deal with the shout connection.
|
|
514
|
+
And the global output_start/stop also deal with the encoder. As a
|
|
515
|
+
result, if shout gets disconnected, encoding will keep going, and the
|
|
516
|
+
sending will keep being attempted, which will at some point trigger a
|
|
517
|
+
restart. *)
|
|
494
518
|
|
|
495
519
|
(** Time after which we should attempt to connect. *)
|
|
496
520
|
val mutable restart_time = 0.
|
|
@@ -499,12 +523,13 @@ class output p =
|
|
|
499
523
|
val mutable dump = None
|
|
500
524
|
|
|
501
525
|
val mutable encoder = None
|
|
526
|
+
method self_sync = source#self_sync
|
|
502
527
|
|
|
503
528
|
method encode frame =
|
|
504
529
|
(* We assume here that there always is
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
530
|
+
an encoder available when the source
|
|
531
|
+
is connected. *)
|
|
532
|
+
match (Cry.get_status connection, encoder) with
|
|
508
533
|
| Cry.Connected _, Some enc -> enc.Encoder.encode frame
|
|
509
534
|
| _ -> Strings.empty
|
|
510
535
|
|
|
@@ -523,7 +548,7 @@ class output p =
|
|
|
523
548
|
| None -> ()
|
|
524
549
|
| Some v -> Hashtbl.replace icy_meta "song" (f v));
|
|
525
550
|
(* Do nothing if shout connection isn't available *)
|
|
526
|
-
|
|
551
|
+
match Cry.get_status connection with
|
|
527
552
|
| Cry.Connected _ -> (
|
|
528
553
|
try
|
|
529
554
|
Cry.update_metadata
|
|
@@ -538,7 +563,7 @@ class output p =
|
|
|
538
563
|
| Cry.Disconnected -> ())
|
|
539
564
|
else (
|
|
540
565
|
(* Encoder is not always present.. *)
|
|
541
|
-
|
|
566
|
+
match encoder with
|
|
542
567
|
| Some encoder -> encoder.Encoder.insert_metadata m
|
|
543
568
|
| None -> ())
|
|
544
569
|
|
|
@@ -603,7 +628,7 @@ class output p =
|
|
|
603
628
|
try List.assoc "User-Agent" headers
|
|
604
629
|
with Not_found -> Printf.sprintf "liquidsoap %s" Configure.version
|
|
605
630
|
in
|
|
606
|
-
let
|
|
631
|
+
let handler =
|
|
607
632
|
Cry.connection ~host ~port ~user ~password ?genre ?url ?description
|
|
608
633
|
~name ~public ~protocol ~mount ~chunked ~audio_info ~user_agent
|
|
609
634
|
~content_type:data.format ()
|
|
@@ -611,17 +636,25 @@ class output p =
|
|
|
611
636
|
List.iter
|
|
612
637
|
(fun (x, y) ->
|
|
613
638
|
(* User-Agent has already been passed to Cry.. *)
|
|
614
|
-
if x <> "User-Agent" then Hashtbl.replace
|
|
639
|
+
if x <> "User-Agent" then Hashtbl.replace handler.Cry.headers x y)
|
|
615
640
|
headers;
|
|
616
641
|
try
|
|
617
|
-
Cry.connect connection
|
|
642
|
+
Cry.connect connection handler;
|
|
618
643
|
self#log#important "Connection setup was successful.";
|
|
619
644
|
|
|
645
|
+
(match source#last_metadata with
|
|
646
|
+
| Some m when send_last_metadata_on_connect -> (
|
|
647
|
+
try
|
|
648
|
+
self#insert_metadata
|
|
649
|
+
(Frame.Metadata.Export.from_metadata ~cover:false m)
|
|
650
|
+
with _ -> ())
|
|
651
|
+
| _ -> ());
|
|
652
|
+
|
|
620
653
|
(* Execute on_connect hook. *)
|
|
621
654
|
on_connect ()
|
|
622
655
|
with
|
|
623
656
|
(* In restart mode, no_connect and no_login are not fatal.
|
|
624
|
-
|
|
657
|
+
The output will just try to reconnect later. *)
|
|
625
658
|
| e ->
|
|
626
659
|
let bt = Printexc.get_raw_backtrace () in
|
|
627
660
|
Utils.log_exception ~log:self#log
|
|
@@ -636,7 +669,7 @@ class output p =
|
|
|
636
669
|
|
|
637
670
|
method icecast_stop =
|
|
638
671
|
(* In some cases it might be possible to output the remaining data,
|
|
639
|
-
|
|
672
|
+
but it's not worth the trouble. *)
|
|
640
673
|
begin
|
|
641
674
|
try ignore ((Option.get encoder).Encoder.stop ()) with _ -> ()
|
|
642
675
|
end;
|
|
@@ -60,7 +60,7 @@ class output ~self_sync ~register_telnet ~name ~groups ~infallible ~on_start
|
|
|
60
60
|
|
|
61
61
|
val mutable sender = None
|
|
62
62
|
|
|
63
|
-
method
|
|
63
|
+
method self_sync =
|
|
64
64
|
if self_sync then
|
|
65
65
|
(`Dynamic, if sender <> None then Some sync_source else None)
|
|
66
66
|
else (`Static, None)
|
|
@@ -43,12 +43,12 @@ let proto =
|
|
|
43
43
|
|
|
44
44
|
let meth = Start_stop.meth ()
|
|
45
45
|
|
|
46
|
-
module Queue =
|
|
46
|
+
module Queue = Queues.Queue
|
|
47
47
|
|
|
48
|
-
(** Given abstract start stop and send methods, creates an output.
|
|
49
|
-
|
|
50
|
-
last ten metadata and setups standard Server commands, including
|
|
51
|
-
|
|
48
|
+
(** Given abstract start stop and send methods, creates an output. Takes care of
|
|
49
|
+
pulling the data out of the source, type checkings, maintains a queue of
|
|
50
|
+
last ten metadata and setups standard Server commands, including start/stop.
|
|
51
|
+
*)
|
|
52
52
|
class virtual output ~output_kind ?clock ?(name = "") ~infallible
|
|
53
53
|
~register_telnet ~(on_start : unit -> unit) ~(on_stop : unit -> unit)
|
|
54
54
|
val_source autostart =
|
|
@@ -66,7 +66,6 @@ class virtual output ~output_kind ?clock ?(name = "") ~infallible
|
|
|
66
66
|
method virtual private start : unit
|
|
67
67
|
method virtual private stop : unit
|
|
68
68
|
method virtual private send_frame : Frame.t -> unit
|
|
69
|
-
method self_sync = source#self_sync
|
|
70
69
|
method fallible = not infallible
|
|
71
70
|
method! source_type : source_type = `Output (self :> Source.active)
|
|
72
71
|
|
|
@@ -141,11 +140,9 @@ class virtual output ~output_kind ?clock ?(name = "") ~infallible
|
|
|
141
140
|
self#on_wake_up (fun () ->
|
|
142
141
|
(* We prefer [name] as an ID over the default, but do not overwrite
|
|
143
142
|
user-defined ID. Our ID will be used for the server interface. *)
|
|
144
|
-
if name <> "" then self#set_id ~
|
|
143
|
+
if name <> "" then self#set_id ~force:false name;
|
|
145
144
|
|
|
146
145
|
self#log#debug "Clock is %s." (Clock.id self#clock);
|
|
147
|
-
self#log#important "Content type is %s."
|
|
148
|
-
(Frame.string_of_content_type self#content_type);
|
|
149
146
|
|
|
150
147
|
if Frame.Fields.is_empty self#content_type then
|
|
151
148
|
failwith
|
|
@@ -193,6 +190,7 @@ class virtual output ~output_kind ?clock ?(name = "") ~infallible
|
|
|
193
190
|
|
|
194
191
|
class dummy ?clock ~infallible ~on_start ~on_stop ~autostart ~register_telnet
|
|
195
192
|
source =
|
|
193
|
+
let s = Lang.to_source source in
|
|
196
194
|
object
|
|
197
195
|
inherit
|
|
198
196
|
output
|
|
@@ -203,6 +201,7 @@ class dummy ?clock ~infallible ~on_start ~on_stop ~autostart ~register_telnet
|
|
|
203
201
|
method private start = ()
|
|
204
202
|
method private stop = ()
|
|
205
203
|
method private send_frame _ = ()
|
|
204
|
+
method self_sync = s#self_sync
|
|
206
205
|
end
|
|
207
206
|
|
|
208
207
|
let _ =
|