Commit 99659e4c authored by Max Kellermann's avatar Max Kellermann

Merge tag 'v0.19.21'

release v0.19.21
parents dc05dd7c 3bbcda91
...@@ -35,7 +35,8 @@ tags ...@@ -35,7 +35,8 @@ tags
/mkinstalldirs /mkinstalldirs
/build /build
/src/mpd /src/mpd
/systemd/mpd.service /systemd/system/mpd.service
/systemd/user/mpd.service
/stamp-h1 /stamp-h1
/src/dsd2pcm/dsd2pcm /src/dsd2pcm/dsd2pcm
......
...@@ -1599,8 +1599,13 @@ FILTER_LIBS = \ ...@@ -1599,8 +1599,13 @@ FILTER_LIBS = \
if HAVE_SYSTEMD if HAVE_SYSTEMD
systemdsystemunit_DATA = \ systemdsystemunit_DATA = \
systemd/mpd.socket \ systemd/system/mpd.socket \
systemd/mpd.service systemd/system/mpd.service
endif
if HAVE_SYSTEMD_USER
systemduserunit_DATA = \
systemd/user/mpd.service
endif endif
...@@ -2356,7 +2361,7 @@ EXTRA_DIST = $(doc_DATA) autogen.sh \ ...@@ -2356,7 +2361,7 @@ EXTRA_DIST = $(doc_DATA) autogen.sh \
$(wildcard $(srcdir)/scripts/*.rb) \ $(wildcard $(srcdir)/scripts/*.rb) \
$(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \ $(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \
$(wildcard $(srcdir)/doc/include/*.xml) \ $(wildcard $(srcdir)/doc/include/*.xml) \
systemd/mpd.socket \ systemd/system/mpd.socket \
android/AndroidManifest.xml \ android/AndroidManifest.xml \
android/build.py \ android/build.py \
android/custom_rules.xml \ android/custom_rules.xml \
......
...@@ -62,6 +62,12 @@ ver 0.20 (not yet released) ...@@ -62,6 +62,12 @@ ver 0.20 (not yet released)
* switch the code base to C++14 * switch the code base to C++14
- GCC 4.9 or clang 3.4 (or newer) recommended - GCC 4.9 or clang 3.4 (or newer) recommended
ver 0.19.21 (2016/12/13)
* decoder
- ffmpeg: fix crash bug
* fix unit test failure after recent "setprio" change
* systemd: add user unit
ver 0.19.20 (2016/12/09) ver 0.19.20 (2016/12/09)
* protocol * protocol
- "setprio" re-enqueues old song if priority has been raised - "setprio" re-enqueues old song if priority has been raised
......
...@@ -52,6 +52,22 @@ if test "x$with_systemdsystemunitdir" != xno; then ...@@ -52,6 +52,22 @@ if test "x$with_systemdsystemunitdir" != xno; then
fi fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
AC_ARG_WITH([systemduserunitdir],
AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd service files]),
[], [with_systemduserunitdir=no])
if test "x$with_systemduserunitdir" = xyes; then
AC_MSG_CHECKING(for systemd)
with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)
if test -z "$with_systemduserunitdir"; then
AC_MSG_ERROR([Failed to detect systemd])
fi
AC_MSG_RESULT([$with_systemduserunitdir])
fi
if test "x$with_systemduserunitdir" != xno; then
AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD_USER, [test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno ])
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Declare Variables dnl Declare Variables
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
...@@ -1498,7 +1514,8 @@ dnl Generate files ...@@ -1498,7 +1514,8 @@ dnl Generate files
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(doc/doxygen.conf) AC_CONFIG_FILES(doc/doxygen.conf)
AC_CONFIG_FILES(systemd/mpd.service) AC_CONFIG_FILES(systemd/system/mpd.service)
AC_CONFIG_FILES(systemd/user/mpd.service)
AC_OUTPUT AC_OUTPUT
echo 'MPD is ready for compilation, type "make" to begin.' echo 'MPD is ready for compilation, type "make" to begin.'
...@@ -151,7 +151,7 @@ apt-get install g++ \ ...@@ -151,7 +151,7 @@ apt-get install g++ \
<application>systemd</application> unit files: a "service" <application>systemd</application> unit files: a "service"
unit and a "socket" unit. These will only be installed when unit and a "socket" unit. These will only be installed when
<application>MPD</application> was configured with <application>MPD</application> was configured with
<parameter>--with-systemdsystemunitdir=/lib/systemd</parameter>. <parameter>--with-systemdsystemunitdir=/lib/systemd/system</parameter>.
</para> </para>
<para> <para>
...@@ -167,6 +167,33 @@ systemctl start mpd.socket</programlisting> ...@@ -167,6 +167,33 @@ systemctl start mpd.socket</programlisting>
<varname>port</varname> settings. <varname>port</varname> settings.
</para> </para>
</section> </section>
<section id="systemd_user">
<title><filename>systemd</filename> user unit</title>
<para>
You can launch <application>MPD</application> as a
<filename>systemd</filename> user unit. The service file will
only be installed when <application>MPD</application> was
configured with
<parameter>--with-systemduserunitdir=/usr/lib/systemd/user</parameter>
or
<parameter>--with-systemduserunitdir=$HOME/.local/share/systemd/user</parameter>.
</para>
<para>
Once the user unit is installed, you can start and stop
<application>MPD</application> like any other service:
</para>
<programlisting>systemctl --user start mpd</programlisting>
<para>
To auto-start <application>MPD</application> upon login, type:
</para>
<programlisting>systemctl --user enable mpd</programlisting>
</section>
</chapter> </chapter>
<chapter id="config"> <chapter id="config">
......
...@@ -68,10 +68,8 @@ FfmpegOpenInput(AVIOContext *pb, ...@@ -68,10 +68,8 @@ FfmpegOpenInput(AVIOContext *pb,
context->pb = pb; context->pb = pb;
int err = avformat_open_input(&context, filename, fmt, nullptr); int err = avformat_open_input(&context, filename, fmt, nullptr);
if (err < 0) { if (err < 0)
avformat_free_context(context);
throw MakeFfmpegError(err, "avformat_open_input() failed"); throw MakeFfmpegError(err, "avformat_open_input() failed");
}
return context; return context;
} }
......
[Unit]
Description=Music Player Daemon
Documentation=man:mpd(1) man:mpd.conf(5)
After=network.target sound.target
[Service]
Type=notify
ExecStart=@prefix@/bin/mpd --no-daemon
# allow MPD to use real-time priority 50
LimitRTPRIO=50
LimitRTTIME=infinity
# disallow writing to /usr, /bin, /sbin, ...
ProtectSystem=yes
# more paranoid security settings
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectControlGroups=yes
# AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh*
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictNamespaces=yes
# Note that "ProtectKernelModules=yes" is missing in the user unit
# because systemd 232 is unable to reduce its own capabilities
# ("Failed at step CAPABILITIES spawning /usr/bin/mpd: Operation not
# permitted")
[Install]
WantedBy=default.target
...@@ -164,21 +164,6 @@ QueuePriorityTest::TestPriority() ...@@ -164,21 +164,6 @@ QueuePriorityTest::TestPriority()
check_descending_priority(&queue, current_order + 1); check_descending_priority(&queue, current_order + 1);
/* priority=60 for the old prio50 item; must not be moved,
because it's before the current song, and it's status
hasn't changed (it was already higher before) */
unsigned c_order = 0;
unsigned c_position = queue.OrderToPosition(c_order);
CPPUNIT_ASSERT_EQUAL(50u, unsigned(queue.items[c_position].priority));
queue.SetPriority(c_position, 60, current_order);
current_order = queue.PositionToOrder(current_position);
CPPUNIT_ASSERT_EQUAL(3u, current_order);
c_order = queue.PositionToOrder(c_position);
CPPUNIT_ASSERT_EQUAL(0u, c_order);
/* move the prio=20 item back */ /* move the prio=20 item back */
a_order = queue.PositionToOrder(a_position); a_order = queue.PositionToOrder(a_position);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment