From c79d1375faf968e4beb78846cdec245ad3603c90 Mon Sep 17 00:00:00 2001
From: Alexander Leidinger <netchild@FreeBSD.org>
Date: Sun, 31 Jul 2005 16:08:03 +0000
Subject: [PATCH] OSS defines AFMT_x32_xE as:         1) 32bit data, packed
 within 32bit (4bytes) boundary.         2) 24bit data, packed within 32bit
 (4bytes) boundary where the data            is stored in the 24 most
 significant bits and least significant 8            bits are not used and
 should be set to 0.

While this might hold true in few cases, lots of applications (notably
mplayer, sweep) really deal / produce 24bit as what they should meant
to be: 24bit data / 3bytes per sample.
To handle this "true" 24bit pcm format add AFMT_x24_xE, so the in-kernel
conversion space did not confuse itself with 32bit variant.

You need to rebuild mplayer after installing this change (this header and
the upcomming kernel changes), if you want to use this new feature.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	multimedia@
---
 sys/sys/soundcard.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h
index 4ae5fe3640c1..d4c4cc5e6d07 100644
--- a/sys/sys/soundcard.h
+++ b/sys/sys/soundcard.h
@@ -180,6 +180,10 @@ struct snd_size {
 #define AFMT_S32_BE	0x00002000	/* Big endian signed 32-bit */
 #define AFMT_U32_LE	0x00004000	/* Little endian unsigned 32-bit */
 #define AFMT_U32_BE	0x00008000	/* Big endian unsigned 32-bit */
+#define AFMT_S24_LE	0x00010000	/* Little endian signed 24-bit */
+#define AFMT_S24_BE	0x00020000	/* Big endian signed 24-bit */
+#define AFMT_U24_LE	0x00040000	/* Little endian unsigned 24-bit */
+#define AFMT_U24_BE	0x00080000	/* Big endian unsigned 24-bit */
 
 #define AFMT_STEREO	0x10000000	/* can do/want stereo	*/