Merge branch '2.4.x' into 2.4.x-saas

Conflicts:
	python_apps/pypo/liquidsoap_scripts/ls_script.liq
	utils/phone_home_stat.php
This commit is contained in:
Naomi Aro 2013-06-26 01:25:26 -04:00
commit f2d5fa96da
114 changed files with 9850 additions and 9170 deletions

View file

@ -0,0 +1,24 @@
if bitrate == 24 then
ignore(output_stereo(%fdkaac(bitrate = 24, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 32 then
ignore(output_stereo(%fdkaac(bitrate = 32, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 48 then
ignore(output_stereo(%fdkaac(bitrate = 48, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 64 then
ignore(output_stereo(%fdkaac(bitrate = 64, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 96 then
ignore(output_stereo(%fdkaac(bitrate = 96, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 128 then
ignore(output_stereo(%fdkaac(bitrate = 128, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 160 then
ignore(output_stereo(%fdkaac(bitrate = 160, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 192 then
ignore(output_stereo(%fdkaac(bitrate = 192, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 224 then
ignore(output_stereo(%fdkaac(bitrate = 224, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 256 then
ignore(output_stereo(%fdkaac(bitrate = 256, aot="mpeg4_he_aac_v2"), !source))
elsif bitrate == 320 then
ignore(output_stereo(%fdkaac(bitrate = 320, aot="mpeg4_he_aac_v2"), !source))
end

View file

@ -1,6 +1,7 @@
import logging
import sys
import time
import traceback
from api_clients.api_client import AirtimeApiClient
def generate_liquidsoap_config(ss):
@ -26,19 +27,21 @@ def generate_liquidsoap_config(ss):
fh.close()
logging.basicConfig(format='%(message)s')
ac = AirtimeApiClient(logging.getLogger())
attempts = 0
max_attempts = 5
max_attempts = 10
successful = False
while True:
while not successful:
try:
ac = AirtimeApiClient(logging.getLogger())
ss = ac.get_stream_setting()
generate_liquidsoap_config(ss)
break
successful = True
except Exception, e:
if attempts == max_attempts:
print "Unable to connect to the Airtime server."
logging.error(str(e))
logging.error("traceback: %s", traceback.format_exc())
sys.exit(1)
else:
time.sleep(3)

View file

@ -1,10 +1,15 @@
def notify(m)
#current_media_id := string_of(m['schedule_table_id'])
command = "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --media-id=#{m['schedule_table_id']} &"
log(command)
system(command)
end
def notify_queue(m)
f = !dynamic_metadata_callback
ignore(f(m))
notify(m)
end
def notify_stream(m)
json_str = string.replace(pattern="\n",(fun (s) -> ""), json_of(m))
#if a string has a single apostrophe in it, let's comment it out by ending the string before right before it
@ -18,12 +23,19 @@ 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}")]
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
[("title", "#{m['artist']} - #{m['title']}")]
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
@ -146,6 +158,12 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
%include "aacplus.liq"
end
%endif
%ifencoder %fdkaac
if type == "fdkaac" then
%include "fdkaac.liq"
end
%endif
else
user_ref = ref user
if user == "" then

View file

@ -24,6 +24,8 @@ default_dj_fade = ref 0.
station_name = ref ''
show_name = ref ''
dynamic_metadata_callback = ref fun (s) -> begin () end
s1_connected = ref ''
s2_connected = ref ''
s3_connected = ref ''
@ -47,7 +49,8 @@ def create_source()
# the crossfade function controls fade in/out
l = crossfade_airtime(l)
l = on_metadata(notify, l)
l = on_metadata(notify_queue, l)
sources := list.append([l], !sources)
server.register(namespace="queues",
"s#{!source_id}_skip",
@ -69,12 +72,10 @@ create_source()
create_source()
queue = add(!sources, normalize=false)
pair = insert_metadata(queue)
dynamic_metadata_callback := fst(pair)
queue = snd(pair)
<<<<<<< HEAD
=======
# the crossfade function controls fade in/out
>>>>>>> 551d65ebf04d877bdba009a92c62bfa4f08eea9c
output.dummy(fallible=true, queue)
http = input.http_restart(id="http")