Merge branch '2.3.x' into devel
This commit is contained in:
commit
894887bd62
5 changed files with 18 additions and 16 deletions
|
@ -12,8 +12,6 @@ ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
|||
exec 2>&1
|
||||
export PYTHONPATH=${api_client_path}
|
||||
|
||||
rm -f /etc/airtime/liquidsoap.cfg
|
||||
|
||||
cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts
|
||||
python generate_liquidsoap_cfg.py
|
||||
|
||||
|
|
|
@ -35,12 +35,14 @@ stop () {
|
|||
start_no_monit() {
|
||||
chown pypo:pypo /var/log/airtime/pypo
|
||||
chown pypo:pypo /var/log/airtime/pypo-liquidsoap
|
||||
chown pypo:pypo /etc/airtime/liquidsoap.cfg
|
||||
|
||||
touch /var/run/airtime-liquidsoap.pid
|
||||
chown pypo:pypo /var/run/airtime-liquidsoap.pid
|
||||
rm -f $PIDFILE
|
||||
touch $PIDFILE
|
||||
chown pypo:pypo $PIDFILE
|
||||
|
||||
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
|
||||
--pidfile /var/run/airtime-liquidsoap.pid --nicelevel -15 --startas $DAEMON
|
||||
--pidfile $PIDFILE --nicelevel -15 --startas $DAEMON
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,8 +66,8 @@ case "${1:-''}" in
|
|||
;;
|
||||
|
||||
'status')
|
||||
if [ -f "/var/run/airtime-liquidsoap.pid" ]; then
|
||||
pid=`cat /var/run/airtime-liquidsoap.pid`
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
pid=`cat $PIDFILE`
|
||||
if [ -d "/proc/$pid" ]; then
|
||||
echo "Liquidsoap is running"
|
||||
exit 0
|
||||
|
|
|
@ -41,13 +41,17 @@ class SilanAnalyzer(Thread):
|
|||
full_path = f['fp']
|
||||
# silence detect(set default queue in and out)
|
||||
try:
|
||||
command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path]
|
||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
out = proc.communicate()[0].strip('\r\n')
|
||||
info = json.loads(out)
|
||||
data = {}
|
||||
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
|
||||
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
|
||||
command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path]
|
||||
try:
|
||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
out = proc.communicate()[0].strip('\r\n')
|
||||
info = json.loads(out)
|
||||
data['cuein'] = str('{0:f}'.format(info['sound'][0][0]))
|
||||
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
|
||||
except Exception, e:
|
||||
self.logger.error(str(command))
|
||||
self.logger.error(e)
|
||||
processed_data.append((f['id'], data))
|
||||
total += 1
|
||||
if total % 5 == 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue