diff options
author | Max Kellermann <max@duempel.org> | 2011-03-19 09:58:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-03-19 09:58:07 +0100 |
commit | 0c9fc2f8090ed225c76296088e6760630eb42779 (patch) | |
tree | 9238436fb89ebf6a91d329eba0f5feec1ad137fd /src/output/oss_plugin.c | |
parent | 1a954748a027aa5b4fc6c85b0ad96c2fa25d53b8 (diff) | |
parent | fe588a255ba713875a21bb98d3b7daf60af2844e (diff) | |
download | mpd-0c9fc2f8090ed225c76296088e6760630eb42779.tar.gz mpd-0c9fc2f8090ed225c76296088e6760630eb42779.tar.xz mpd-0c9fc2f8090ed225c76296088e6760630eb42779.zip |
Merge commit 'release-0.16.2'
Conflicts:
Makefile.am
NEWS
configure.ac
Diffstat (limited to '')
-rw-r--r-- | src/output/oss_plugin.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index bd3ccb774..d7df594d3 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -41,6 +41,15 @@ # include <sys/soundcard.h> #endif /* !(defined(__OpenBSD__) || defined(__NetBSD__) */ +/* We got bug reports from FreeBSD users who said that the two 24 bit + formats generate white noise on FreeBSD, but 32 bit works. This is + a workaround until we know what exactly is expected by the kernel + audio drivers. */ +#ifndef __linux__ +#undef AFMT_S24_PACKED +#undef AFMT_S24_NE +#endif + struct oss_data { int fd; const char *device; @@ -347,7 +356,7 @@ oss_setup_sample_rate(int fd, struct audio_format *audio_format, case SUCCESS: if (!audio_valid_sample_rate(sample_rate)) break; - + audio_format->sample_rate = sample_rate; return true; @@ -461,6 +470,12 @@ oss_setup_sample_format(int fd, struct audio_format *audio_format, break; audio_format->format = mpd_format; + +#ifdef AFMT_S24_PACKED + if (oss_format == AFMT_S24_PACKED) + audio_format->reverse_endian = + G_BYTE_ORDER != G_LITTLE_ENDIAN; +#endif return true; case ERROR: @@ -502,6 +517,12 @@ oss_setup_sample_format(int fd, struct audio_format *audio_format, break; audio_format->format = mpd_format; + +#ifdef AFMT_S24_PACKED + if (oss_format == AFMT_S24_PACKED) + audio_format->reverse_endian = + G_BYTE_ORDER != G_LITTLE_ENDIAN; +#endif return true; case ERROR: |