diff --git a/src/Makefile b/src/Makefile index 6699df0d68..10d4ce2089 100644 --- a/src/Makefile +++ b/src/Makefile @@ -180,7 +180,6 @@ tools = tools/extralib.ml tools/JSON.ml tools/lifecycle.ml \ tools/stringView.ml tools/strings.ml tools/runtime_error.ml \ tools/utils.ml tools/doc.ml tools/plug.ml \ tools/rqueue.ml tools/unifier.ml \ - $(if $(W_FFMPEG_AVDEVICE),tools/liqavdevice.ml) \ $(if $(W_LAME_DYN),tools/lame_dynlink.ml) \ $(if $(W_FDKAAC_DYN),tools/fdkaac_dynlink.ml) \ tools/wav_aiff.ml tools/tutils.ml \ @@ -239,6 +238,7 @@ builtins = lang/lang_builtins.ml lang/builtins_ref.ml \ liquidsoap_sources= \ tools/log.ml $(tools) converters/audio_converter.ml $(stream) \ $(if $(W_FFMPEG_AVUTIL),tools/ffmpeg_utils.ml) \ + $(if $(W_FFMPEG_AVDEVICE),tools/liqavdevice.ml) \ converters/video_converter.ml \ decoder/decoder_utils.ml decoder/decoder.ml \ tools/liq_time.ml $(if $(W_POSIX_TIME2),tools/liq_posix_time.ml) \ diff --git a/src/tools/ffmpeg_utils.ml b/src/tools/ffmpeg_utils.ml index a3749d1b97..6644d2465b 100644 --- a/src/tools/ffmpeg_utils.ml +++ b/src/tools/ffmpeg_utils.ml @@ -63,9 +63,8 @@ let conf_alpha = Dtools.Conf.bool ~p:(conf_ffmpeg#plug "alpha") ~d:false "Import and export alpha layers when converting to and from ffmpeg frames." -(* -let () = - Lifecycle.before_start (fun () -> +let log_start_atom = + Dtools.Init.make (fun () -> let verbosity = match conf_verbosity#get with | "quiet" -> `Quiet @@ -83,7 +82,8 @@ let () = let level = conf_level#get in Avutil.Log.set_level verbosity; Avutil.Log.set_callback (fun s -> log#f level "%s" (String.trim s))) -*) + +let () = Lifecycle.before_start (fun () -> Dtools.Init.exec log_start_atom) let best_pts frame = match Avutil.frame_pts frame with diff --git a/src/tools/ffmpeg_utils.mli b/src/tools/ffmpeg_utils.mli index bfe49f38c9..2bc26ea658 100644 --- a/src/tools/ffmpeg_utils.mli +++ b/src/tools/ffmpeg_utils.mli @@ -23,6 +23,7 @@ open Mm val log : Log.t +val log_start_atom : Dtools.Init.t val conf_ffmpeg : Dtools.Conf.ut val conf_log : Dtools.Conf.ut val conf_verbosity : string Dtools.Conf.t diff --git a/src/tools/liqavdevice.ml b/src/tools/liqavdevice.ml index b13b871fba..0df71ca845 100644 --- a/src/tools/liqavdevice.ml +++ b/src/tools/liqavdevice.ml @@ -1 +1,2 @@ -let () = Avdevice.init () +let () = + ignore (Dtools.Init.make ~after:[Ffmpeg_utils.log_start_atom] Avdevice.init)