summaryrefslogtreecommitdiffstats
authorMax Kellermann <[email protected]>2011-02-27 23:00:41 (GMT)
committer Max Kellermann <[email protected]>2011-02-27 23:00:41 (GMT)
commitee9c60fad46c1da7c517b84e37a9c4bc41949efd (patch) (side-by-side diff)
tree245629c6efb4abcdd11f5c9eefff34e1fcc7c4b3
parente2574848709266dc9b74d588542342062fe562f6 (diff)
downloadmpd-ee9c60fad46c1da7c517b84e37a9c4bc41949efd.zip
mpd-ee9c60fad46c1da7c517b84e37a9c4bc41949efd.tar.gz
mpd-ee9c60fad46c1da7c517b84e37a9c4bc41949efd.tar.bz2
output/oss: AFMT_S24_PACKED is little-endian
According to the Solaris dsp manpage, AFMT_S24_PACKED is little-endian: http://download.oracle.com/docs/cd/E19963-01/821-1475/6nmf5baot/index.html The Minix soundcard.h header says the same.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--NEWS1
-rw-r--r--src/output/oss_plugin.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 5316279..64353a7 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ ver 0.16.2 (2011/??/??)
- gme: detect end of song
* output:
- httpd: fix uninitialized variable
+ - oss: AFMT_S24_PACKED is little-endian
ver 0.16.1 (2011/01/09)
diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c
index f5ae80e..26d674e 100644
--- a/src/output/oss_plugin.c
+++ b/src/output/oss_plugin.c
@@ -461,6 +461,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 +508,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: