aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-08 14:50:44 +0200
committerMax Kellermann <max@duempel.org>2011-10-08 14:50:44 +0200
commitb43bf4dd741f81239c7ae0c99a048ef0be6286ed (patch)
tree3cb219018da3e22bab9b69c1bb6f94bb312b0329
parent14424281a0e1407ca04ef05a50541a4178f70e91 (diff)
parent5ed0eb51d16507dcca9764771af8f05f08a078f9 (diff)
Merge branch 'v0.16.x'
-rw-r--r--NEWS2
-rw-r--r--configure.ac10
-rw-r--r--src/output/alsa_output_plugin.c9
-rw-r--r--src/output/openal_output_plugin.c18
4 files changed, 26 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index 2577f9d9..48d3d80c 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,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/configure.ac b/configure.ac
index 98062eea..84f36f8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,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
diff --git a/src/output/alsa_output_plugin.c b/src/output/alsa_output_plugin.c
index 41293272..af6d1b18 100644
--- a/src/output/alsa_output_plugin.c
+++ b/src/output/alsa_output_plugin.c
@@ -193,6 +193,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;
@@ -209,10 +212,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
diff --git a/src/output/openal_output_plugin.c b/src/output/openal_output_plugin.c
index 1473659f..622cf559 100644
--- a/src/output/openal_output_plugin.c
+++ b/src/output/openal_output_plugin.c
@@ -67,26 +67,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