summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-01-20 07:59:56 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-01-20 07:59:56 +0000
commit06beaaa1ec55c398386df62042566301d96fbcff (patch)
tree710937007ca688e9c9f79a10a913e52d2b0e3c89 /sys/dev
parent7b29e0ca43c953e128544e27a85a4ca86674519b (diff)
Set byte order the default encoding in the attach method to
native byte order. No behaviour change, as attach time parameters are just hints, except thay this makes audioctl output nicer if the device was never opened.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/audio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index dc2e4aadc6a..c0f079ed1c8 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.141 2016/01/09 23:24:31 jsg Exp $ */
+/* $OpenBSD: audio.c,v 1.142 2016/01/20 07:59:55 ratchov Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
@@ -1083,7 +1083,11 @@ audio_attach(struct device *parent, struct device *self, void *aux)
}
/* set defaults */
- sc->sw_enc = AUDIO_ENCODING_SLINEAR;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ sc->sw_enc = AUDIO_ENCODING_SLINEAR_LE;
+#else
+ sc->sw_enc = AUDIO_ENCODING_SLINEAR_BE;
+#endif
sc->bits = 16;
sc->bps = 2;
sc->msb = 1;