From 06beaaa1ec55c398386df62042566301d96fbcff Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 20 Jan 2016 07:59:56 +0000 Subject: 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. --- sys/dev/audio.c | 8 ++++++-- 1 file 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 * @@ -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; -- cgit v1.2.3