From 72ff9bd3e67e1fb9acc7cc7857944d5b25d3e9c5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Oct 2011 09:55:02 +0200 Subject: configure.ac: disable systemd service by default Defaulting to "with systemd" causes problems for users who install MPD as an unprivileged user, and it breaks "make distcheck". It looks like enabling it by default creates too many practical problems for unexperienced users. With --with-systemdsystemunitdir (without a parameter), configure.ac attempts to auto-detect systemd. --- configure.ac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1c1a4b91f..9908e51fa 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,15 @@ AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), - [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) + [], [with_systemdsystemunitdir=no]) +if test "x$with_systemdsystemunitdir" = xyes; then + AC_MSG_CHECKING(for systemd) + with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) + if test -z "$with_systemdsystemunitdir"; then + AC_MSG_ERROR([Failed to detect systemd]) + fi + AC_MSG_RESULT([$with_systemdsystemunitdir]) +fi if test "x$with_systemdsystemunitdir" != xno; then AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) fi -- cgit v1.2.3 From 72a1ca3b99302e229d4a7f699c45b9fa7288c1a8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 8 Oct 2011 14:37:54 +0200 Subject: output/alsa: remove "default" case from switch Allow gcc to warn when a new format isn't supported. --- src/output/alsa_plugin.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c index 422264f53..ae06847c2 100644 --- a/src/output/alsa_plugin.c +++ b/src/output/alsa_plugin.c @@ -186,6 +186,9 @@ static snd_pcm_format_t get_bitformat(enum sample_format sample_format) { switch (sample_format) { + case SAMPLE_FORMAT_UNDEFINED: + return SND_PCM_FORMAT_UNKNOWN; + case SAMPLE_FORMAT_S8: return SND_PCM_FORMAT_S8; @@ -202,10 +205,10 @@ get_bitformat(enum sample_format sample_format) case SAMPLE_FORMAT_S32: return SND_PCM_FORMAT_S32; - - default: - return SND_PCM_FORMAT_UNKNOWN; } + + assert(false); + return SND_PCM_FORMAT_UNKNOWN; } static snd_pcm_format_t -- cgit v1.2.3 From 5ed0eb51d16507dcca9764771af8f05f08a078f9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 8 Oct 2011 14:39:40 +0200 Subject: output/openal: auto-fallback to mono if channel count is unsupported .. instead of failing playback completely. --- NEWS | 2 ++ src/output/openal_plugin.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 17169a617..725d3801c 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,8 @@ ver 0.16.5 (2010/??/??) - ffmpeg: higher precision timestamps - ffmpeg: don't require key frame for seeking - fix CUE track seeking +* output: + - openal: auto-fallback to mono if channel count is unsupported * player: - make seeking to CUE track more reliable - the "seek" command works when MPD is stopped diff --git a/src/output/openal_plugin.c b/src/output/openal_plugin.c index 767b3eb17..0a8f253b2 100644 --- a/src/output/openal_plugin.c +++ b/src/output/openal_plugin.c @@ -64,26 +64,26 @@ openal_audio_format(struct audio_format *audio_format) return AL_FORMAT_STEREO16; if (audio_format->channels == 1) return AL_FORMAT_MONO16; - break; + + /* fall back to mono */ + audio_format->channels = 1; + return openal_audio_format(audio_format); case SAMPLE_FORMAT_S8: if (audio_format->channels == 2) return AL_FORMAT_STEREO8; if (audio_format->channels == 1) return AL_FORMAT_MONO8; - break; + + /* fall back to mono */ + audio_format->channels = 1; + return openal_audio_format(audio_format); default: /* fall back to 16 bit */ audio_format->format = SAMPLE_FORMAT_S16; - if (audio_format->channels == 2) - return AL_FORMAT_STEREO16; - if (audio_format->channels == 1) - return AL_FORMAT_MONO16; - break; + return openal_audio_format(audio_format); } - - return 0; } static bool -- cgit v1.2.3