Files
packages/sound/mpd/files/mpd.init
T
Alexandru Ardelean cd73d212ad mpd: update to 0.23.17
Drop 020-string-view.patch: mpd 0.23.17 uses std::string_view directly
in src/tag/GenParseName.cxx, making the patch redundant.

Changes since 0.23.16:
- Optimize the "albumart" command to send larger chunks when available
- Explicitly disallow 'idle' and 'noidle' commands in command lists
- Require libnfs 4.0 or later for NFS storage support
- Trigger inotify database update after symlink creation
- Prefer FFmpeg over sndfile and audiofile for DTS-WAV support
- Add support for libfmt 11.1

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-05-06 21:05:36 +03:00

45 lines
925 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2007-2014 OpenWrt.org
START=93
USE_PROCD=1
PROG=/usr/bin/mpd
CONFIGFILE=/etc/mpd.conf
NICEPRIO=-10
USER="mpd"
GROUP="mpd"
#TODO: Add uci config - nice, config
start_service() {
local pld lport
#create mpd directories from config
pld=$(grep ^playlist_directory "$CONFIGFILE" | head -1 | cut -d '"' -f 2 | sed "s/~/\/root/g")
[ -z "$pld" ] && pld="/tmp/mpd"
if [ ! -d "$pld" ]; then
mkdir -m 0755 -p "$pld"
chown $USER:$GROUP $pld
fi
lport=$(grep ^port "$CONFIGFILE" | cut -d "\"" -f 2)
[ -z "$lport" ] && lport=6600
procd_open_instance
procd_add_mdns "mpd" "tcp" "$lport"
procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
procd_set_param user "$USER"
procd_set_param group "$GROUP"
procd_set_param stderr 1
# Give MPD some real-time priority
procd_set_param nice "$NICEPRIO"
procd_close_instance
}
reload_service() {
procd_send_signal "$PROG"
}