diff --git a/python_apps/pypo/liquidsoap_scripts/fdkaac.liq b/python_apps/pypo/liquidsoap_scripts/fdkaac.liq index 491606802..0c6945221 100644 --- a/python_apps/pypo/liquidsoap_scripts/fdkaac.liq +++ b/python_apps/pypo/liquidsoap_scripts/fdkaac.liq @@ -1,24 +1,24 @@ if bitrate == 24 then - ignore(output_stereo(%fdkaac(bitrate = 24), !source)) + ignore(output_stereo(%fdkaac(bitrate = 24, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 32 then - ignore(output_stereo(%fdkaac(bitrate = 32), !source)) + ignore(output_stereo(%fdkaac(bitrate = 32, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 48 then - ignore(output_stereo(%fdkaac(bitrate = 48), !source)) + ignore(output_stereo(%fdkaac(bitrate = 48, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 64 then - ignore(output_stereo(%fdkaac(bitrate = 64), !source)) + ignore(output_stereo(%fdkaac(bitrate = 64, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 96 then - ignore(output_stereo(%fdkaac(bitrate = 96), !source)) + ignore(output_stereo(%fdkaac(bitrate = 96, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 128 then - ignore(output_stereo(%fdkaac(bitrate = 128), !source)) + ignore(output_stereo(%fdkaac(bitrate = 128, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 160 then - ignore(output_stereo(%fdkaac(bitrate = 160), !source)) + ignore(output_stereo(%fdkaac(bitrate = 160, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 192 then - ignore(output_stereo(%fdkaac(bitrate = 192), !source)) + ignore(output_stereo(%fdkaac(bitrate = 192, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 224 then - ignore(output_stereo(%fdkaac(bitrate = 224), !source)) + ignore(output_stereo(%fdkaac(bitrate = 224, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 256 then - ignore(output_stereo(%fdkaac(bitrate = 256), !source)) + ignore(output_stereo(%fdkaac(bitrate = 256, aot="mpeg4_he_aac_v2"), !source)) elsif bitrate == 320 then - ignore(output_stereo(%fdkaac(bitrate = 320), !source)) + ignore(output_stereo(%fdkaac(bitrate = 320, aot="mpeg4_he_aac_v2"), !source)) end diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index 54530a755..e2123e26d 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -5,7 +5,8 @@ def notify(m) end def notify_queue(m) - queue_metadata := m + f = !dynamic_metadata_callback + ignore(f(m)) notify(m) end @@ -22,17 +23,20 @@ end # A function applied to each metadata chunk def append_title(m) = log("Using stream_format #{!stream_metadata_type}") - if !stream_metadata_type == 1 then - [("title", "#{!show_name} - #{m['artist']} - #{m['title']}")] - elsif !stream_metadata_type == 2 then - [("title", "#{!station_name} - #{!show_name}")] - else - [("title", "#{m['artist']} - #{m['title']}")] - end -end -def queue_metadata_callback(m) = - !queue_metadata + if list.mem_assoc("mapped", m) then + #protection against applying this function twice. It shouldn't be happening + #and bug file with Liquidsoap. + m + else + if !stream_metadata_type == 1 then + [("title", "#{!show_name} - #{m['artist']} - #{m['title']}"), ("mapped", "true")] + elsif !stream_metadata_type == 2 then + [("title", "#{!station_name} - #{!show_name}"), ("mapped", "true")] + else + [("title", "#{m['artist']} - #{m['title']}"), ("mapped", "true")] + end + end end def crossfade_airtime(s) diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index 15ffeffa1..36d85a372 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -24,7 +24,7 @@ default_dj_fade = ref 0. station_name = ref '' show_name = ref '' -queue_metadata = ref [] +dynamic_metadata_callback = ref fun (s) -> begin () end s1_connected = ref '' s2_connected = ref '' @@ -72,7 +72,9 @@ create_source() queue = add(!sources, normalize=false) -queue = map_metadata(update=false, queue_metadata_callback, queue) +pair = insert_metadata(queue) +dynamic_metadata_callback := fst(pair) +queue = snd(pair) output.dummy(fallible=true, queue)