Commit afd60cec authored by Florian Schlichting's avatar Florian Schlichting

Imported Upstream version 0.18.9

parent a17324af
......@@ -10296,8 +10296,8 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
@ENABLE_DOCUMENTATION_FALSE@clean-local:
@ENABLE_DOCUMENTATION_FALSE@install-data-local:
@ENABLE_DOCUMENTATION_FALSE@clean-local:
@ENABLE_DOCUMENTATION_FALSE@uninstall-local:
clean: clean-am
......
ver 0.18.9 (2014/03/02)
* protocol
- "findadd" requires the "add" permission
* output
- alsa: improved workaround for noise after manual song change
* decoder
- vorbis: fix linker failure when libvorbis/libogg are static
* encoder
- vorbis: fix another linker failure
* output
- pipe: fix hanging child process due to blocked signals
* fix build failure due to missing signal.h include
ver 0.18.8 (2014/02/07)
* decoder
- ffmpeg: support libav v10_alpha1
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for mpd 0.18.8.
# Generated by GNU Autoconf 2.69 for mpd 0.18.9.
#
# Report bugs to <mpd-devel@musicpd.org>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='mpd'
PACKAGE_TARNAME='mpd'
PACKAGE_VERSION='0.18.8'
PACKAGE_STRING='mpd 0.18.8'
PACKAGE_VERSION='0.18.9'
PACKAGE_STRING='mpd 0.18.9'
PACKAGE_BUGREPORT='mpd-devel@musicpd.org'
PACKAGE_URL=''
......@@ -1673,7 +1673,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures mpd 0.18.8 to adapt to many kinds of systems.
\`configure' configures mpd 0.18.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1743,7 +1743,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of mpd 0.18.8:";;
short | recursive ) echo "Configuration of mpd 0.18.9:";;
esac
cat <<\_ACEOF
......@@ -2041,7 +2041,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
mpd configure 0.18.8
mpd configure 0.18.9
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2494,7 +2494,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by mpd $as_me 0.18.8, which was
It was created by mpd $as_me 0.18.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3364,7 +3364,7 @@ fi
# Define the identity of the package.
PACKAGE='mpd'
VERSION='0.18.8'
VERSION='0.18.9'
cat >>confdefs.h <<_ACEOF
......@@ -12236,12 +12236,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_VORBIS_CFLAGS="$VORBIS_CFLAGS"
else
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbis vorbisfile ogg\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbis vorbisfile ogg") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisfile vorbis ogg\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisfile vorbis ogg") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_VORBIS_CFLAGS=`$PKG_CONFIG --cflags "vorbis vorbisfile ogg" 2>/dev/null`
pkg_cv_VORBIS_CFLAGS=`$PKG_CONFIG --cflags "vorbisfile vorbis ogg" 2>/dev/null`
else
pkg_failed=yes
fi
......@@ -12254,12 +12254,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_VORBIS_LIBS="$VORBIS_LIBS"
else
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbis vorbisfile ogg\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbis vorbisfile ogg") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisfile vorbis ogg\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisfile vorbis ogg") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_VORBIS_LIBS=`$PKG_CONFIG --libs "vorbis vorbisfile ogg" 2>/dev/null`
pkg_cv_VORBIS_LIBS=`$PKG_CONFIG --libs "vorbisfile vorbis ogg" 2>/dev/null`
else
pkg_failed=yes
fi
......@@ -12278,9 +12278,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
VORBIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbis vorbisfile ogg"`
VORBIS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbisfile vorbis ogg"`
else
VORBIS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbis vorbisfile ogg"`
VORBIS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbisfile vorbis ogg"`
fi
# Put the nasty error message in config.log where it belongs
echo "$VORBIS_PKG_ERRORS" >&5
......@@ -12864,12 +12864,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_VORBISENC_CFLAGS="$VORBISENC_CFLAGS"
else
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc vorbis\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisenc vorbis") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc vorbis ogg\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisenc vorbis ogg") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_VORBISENC_CFLAGS=`$PKG_CONFIG --cflags "vorbisenc vorbis" 2>/dev/null`
pkg_cv_VORBISENC_CFLAGS=`$PKG_CONFIG --cflags "vorbisenc vorbis ogg" 2>/dev/null`
else
pkg_failed=yes
fi
......@@ -12882,12 +12882,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_VORBISENC_LIBS="$VORBISENC_LIBS"
else
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc vorbis\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisenc vorbis") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc vorbis ogg\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisenc vorbis ogg") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_VORBISENC_LIBS=`$PKG_CONFIG --libs "vorbisenc vorbis" 2>/dev/null`
pkg_cv_VORBISENC_LIBS=`$PKG_CONFIG --libs "vorbisenc vorbis ogg" 2>/dev/null`
else
pkg_failed=yes
fi
......@@ -12906,9 +12906,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
VORBISENC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbisenc vorbis"`
VORBISENC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbisenc vorbis ogg"`
else
VORBISENC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbisenc vorbis"`
VORBISENC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbisenc vorbis ogg"`
fi
# Put the nasty error message in config.log where it belongs
echo "$VORBISENC_PKG_ERRORS" >&5
......@@ -18460,7 +18460,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by mpd $as_me 0.18.8, which was
This file was extended by mpd $as_me 0.18.9, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -18526,7 +18526,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
mpd config.status 0.18.8
mpd config.status 0.18.9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_PREREQ(2.60)
AC_INIT(mpd, 0.18.8, mpd-devel@musicpd.org)
AC_INIT(mpd, 0.18.9, mpd-devel@musicpd.org)
VERSION_MAJOR=0
VERSION_MINOR=18
......@@ -1023,7 +1023,7 @@ if test x$enable_tremor = xyes; then
fi
fi
MPD_AUTO_PKG(vorbis, VORBIS, [vorbis vorbisfile ogg],
MPD_AUTO_PKG(vorbis, VORBIS, [vorbisfile vorbis ogg],
[Ogg Vorbis decoder], [libvorbis not found])
if test x$enable_vorbis = xyes; then
AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support])
......@@ -1139,7 +1139,7 @@ fi
AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes)
dnl ---------------------------- Ogg Vorbis Encoder ---------------------------
MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis],
MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis ogg],
[Ogg Vorbis encoder], [libvorbisenc not found])
if test x$enable_vorbis_encoder = xyes; then
......
......@@ -31,7 +31,7 @@ PROJECT_NAME = MPD
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.18.8
PROJECT_NUMBER = 0.18.9
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
......@@ -90,7 +90,7 @@ static const struct command commands[] = {
{ "disableoutput", PERMISSION_ADMIN, 1, 1, handle_disableoutput },
{ "enableoutput", PERMISSION_ADMIN, 1, 1, handle_enableoutput },
{ "find", PERMISSION_READ, 2, -1, handle_find },
{ "findadd", PERMISSION_READ, 2, -1, handle_findadd},
{ "findadd", PERMISSION_ADD, 2, -1, handle_findadd},
{ "idle", PERMISSION_READ, 0, -1, handle_idle },
{ "kill", PERMISSION_ADMIN, -1, -1, handle_kill },
{ "list", PERMISSION_READ, 1, -1, handle_list },
......
......@@ -39,6 +39,12 @@
#include <algorithm>
#ifdef USE_SIGNALFD
#include <pthread.h>
#endif
#include <signal.h>
class SignalMonitor final : private SocketMonitor {
#ifdef USE_SIGNALFD
SignalFD fd;
......@@ -99,7 +105,21 @@ static std::atomic_bool signal_pending[MAX_SIGNAL];
static Manual<SignalMonitor> monitor;
#ifndef USE_SIGNALFD
#ifdef USE_SIGNALFD
/**
* This is a pthread_atfork() callback that unblocks the signals that
* were blocked for our signalfd(). Without this, our child processes
* would inherit the blocked signals.
*/
static void
at_fork_child()
{
sigprocmask(SIG_UNBLOCK, &signal_mask, nullptr);
}
#else
static void
SignalCallback(int signo)
{
......@@ -108,6 +128,7 @@ SignalCallback(int signo)
if (!signal_pending[signo].exchange(true))
monitor->WakeUp();
}
#endif
void
......@@ -115,6 +136,8 @@ SignalMonitorInit(EventLoop &loop)
{
#ifdef USE_SIGNALFD
sigemptyset(&signal_mask);
pthread_atfork(nullptr, nullptr, at_fork_child);
#endif
monitor.Construct(loop);
......
......@@ -106,12 +106,16 @@ struct AlsaOutput {
snd_pcm_uframes_t period_position;
/**
* Set to non-zero when the Raspberry Pi workaround has been
* activated in alsa_recover(); decremented by each write.
* This will avoid activating it again, leading to an endless
* loop. This problem was observed with a "RME Digi9636/52".
* Do we need to call snd_pcm_prepare() before the next write?
* It means that we put the device to SND_PCM_STATE_SETUP by
* calling snd_pcm_drop().
*
* Without this flag, we could easily recover after a failed
* optimistic write (returning -EBADFD), but the Raspberry Pi
* audio driver is infamous for generating ugly artefacts from
* this.
*/
unsigned pi_workaround;
bool must_prepare;
/**
* This buffer gets allocated after opening the ALSA device.
......@@ -676,8 +680,6 @@ alsa_open(struct audio_output *ao, AudioFormat &audio_format, Error &error)
{
AlsaOutput *ad = (AlsaOutput *)ao;
ad->pi_workaround = 0;
int err = snd_pcm_open(&ad->pcm, alsa_device(ad),
SND_PCM_STREAM_PLAYBACK, ad->mode);
if (err < 0) {
......@@ -699,6 +701,8 @@ alsa_open(struct audio_output *ao, AudioFormat &audio_format, Error &error)
ad->in_frame_size = audio_format.GetFrameSize();
ad->out_frame_size = ad->pcm_export->GetFrameSize(audio_format);
ad->must_prepare = false;
return true;
}
......@@ -736,29 +740,6 @@ alsa_recover(AlsaOutput *ad, int err)
case SND_PCM_STATE_XRUN:
ad->period_position = 0;
err = snd_pcm_prepare(ad->pcm);
if (err == 0 && ad->pi_workaround == 0) {
/* this works around a driver bug observed on
the Raspberry Pi: after snd_pcm_drop(), the
whole ring buffer must be invalidated, but
the snd_pcm_prepare() call above makes the
driver play random data that just happens
to be still in the buffer; by adding and
cancelling some silence, this bug does not
occur */
alsa_write_silence(ad, ad->period_frames);
/* cancel the silence data right away to avoid
increasing latency; even though this
function call invalidates the portion of
silence, the driver seems to avoid the
bug */
snd_pcm_reset(ad->pcm);
/* disable the workaround for some time */
ad->pi_workaround = 8;
}
break;
case SND_PCM_STATE_DISCONNECTED:
break;
......@@ -801,6 +782,7 @@ alsa_cancel(struct audio_output *ao)
AlsaOutput *ad = (AlsaOutput *)ao;
ad->period_position = 0;
ad->must_prepare = true;
snd_pcm_drop(ad->pcm);
}
......@@ -822,6 +804,16 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
assert(size % ad->in_frame_size == 0);
if (ad->must_prepare) {
ad->must_prepare = false;
int err = snd_pcm_prepare(ad->pcm);
if (err < 0) {
error.Set(alsa_output_domain, err, snd_strerror(-err));
return 0;
}
}
chunk = ad->pcm_export->Export(chunk, size, size);
assert(size % ad->out_frame_size == 0);
......@@ -834,9 +826,6 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
ad->period_position = (ad->period_position + ret)
% ad->period_frames;
if (ad->pi_workaround > 0)
--ad->pi_workaround;
size_t bytes_written = ret * ad->out_frame_size;
return ad->pcm_export->CalcSourceSize(bytes_written);
}
......
......@@ -369,8 +369,6 @@ pulse_output_enable(struct audio_output *ao, Error &error)
po->mainloop = pa_threaded_mainloop_new();
if (po->mainloop == nullptr) {
g_free(po);
error.Set(pulse_output_domain,
"pa_threaded_mainloop_new() has failed");
return false;
......
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