Merge branch 'v0.18.x'

This commit is contained in:
Max Kellermann 2014-02-18 21:46:41 +01:00
commit c32477a223
3 changed files with 32 additions and 3 deletions

8
NEWS
View File

@ -35,6 +35,14 @@ ver 0.19 (not yet released)
* allow playlist directory without music directory
* install systemd unit for socket activation
ver 0.18.9 (not yet released)
* 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
ver 0.18.8 (2014/02/07)
* decoder
- ffmpeg: support libav v10_alpha1

View File

@ -1222,7 +1222,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])
@ -1350,7 +1350,7 @@ fi
AM_CONDITIONAL(ENABLE_SHINE_ENCODER, test x$enable_shine_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

View File

@ -39,6 +39,10 @@
#include <algorithm>
#ifdef USE_SIGNALFD
#include <pthread.h>
#endif
#include <assert.h>
#include <signal.h>
@ -94,7 +98,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)
{
@ -103,6 +121,7 @@ SignalCallback(int signo)
if (!signal_pending[signo].exchange(true))
monitor->WakeUp();
}
#endif
void
@ -110,6 +129,8 @@ SignalMonitorInit(EventLoop &loop)
{
#ifdef USE_SIGNALFD
sigemptyset(&signal_mask);
pthread_atfork(nullptr, nullptr, at_fork_child);
#endif
monitor.Construct(loop);