MPD: Upgrade to 0.18.11, convert to procd, refresh patches

Signed-off-by: Ted Hess <thess@kitschensync.net>
This commit is contained in:
Ted Hess
2014-07-30 11:40:21 -04:00
parent 911bc46f3a
commit a3255798d7
6 changed files with 46 additions and 85 deletions

View File

@@ -1,28 +1,26 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2007-2011 OpenWrt.org
# Copyright (C) 2007-2014 OpenWrt.org
START=93
start() {
#create mpd directories
pld=`grep ^playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
USE_PROCD=1
PROG=/usr/bin/mpd
CONFIGFILE=/etc/mpd.conf
NICEPRIO=-10
#TODO: Add uci config - nice, config
start_service() {
#create mpd directories from config
local pld=`grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
if [ ! -d $pld ]; then
mkdir -m 0755 -p $pld
fi
# Set the initial volume to something manageable
[ -x /usr/bin/amixer ] && /usr/bin/amixer set PCM 40
if [ -x /bin/nice ]; then
# This has real-time constraints, so let's at least tell the OS
# that this should have higher priority to avoid skipping
# when doing other things in the background.
nice -n -10
fi
service_start /usr/bin/mpd
}
stop() {
service_stop /usr/bin/mpd
procd_open_instance
procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
# Give MPD some real-time priority
procd_set_param nice "$NICEPRIO"
procd_close_instance
}