diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-11-05 15:23:19 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-11-05 15:23:19 +0000 |
commit | e739e5f9276dcaa4b2b6f4618d71f093a53f815b (patch) | |
tree | 1cd0323ff4436acb201c17d6983f46b475d0b9ae /usr.bin/aucat/headers.c | |
parent | a4b29f41786044a9124a64678ddf5d0c29e3d96e (diff) |
Convert ulaw/alaw to native format (ie using ADATA_XXX defines) rather
than s16 (using hardcoded constants). Currently s16 is the native format,
so no behavior change.
Diffstat (limited to 'usr.bin/aucat/headers.c')
-rw-r--r-- | usr.bin/aucat/headers.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/aucat/headers.c b/usr.bin/aucat/headers.c index 37594e2afc2..f53f3ef8b54 100644 --- a/usr.bin/aucat/headers.c +++ b/usr.bin/aucat/headers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: headers.c,v 1.18 2010/06/05 16:54:19 ratchov Exp $ */ +/* $OpenBSD: headers.c,v 1.19 2010/11/05 15:23:18 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -148,17 +148,18 @@ wav_readfmt(int fd, unsigned csize, struct aparams *par, short **map) par->bits = bits; par->le = 1; par->sig = (bits <= 8) ? 0 : 1; /* ask microsoft why... */ + par->msb = 1; } else { if (bits != 8) { warnx("%u: mulaw/alaw encoding not 8-bit", bits); return 0; } - par->bits = 8 * sizeof(short); - par->bps = sizeof(short); - par->le = NATIVE_LE; + par->bits = ADATA_BITS; + par->bps = sizeof(adata_t); + par->le = ADATA_LE; par->sig = 1; + par->msb = 0; } - par->msb = 1; par->cmax = cmax; par->rate = rate; return 1; |