From 9dd9ccbd8d79a7dccd93be0a1e26028ca1d89d42 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 10 May 2013 15:04:21 +0200 Subject: audio: add double sample format To make this easier, get rid of the direct mapping of the AF_FORMAT_BITS_MASK bit field to number of bytes. This way we can throw away the unused AF_FORMAT_48BIT and don't have to add ..._56BIT. --- audio/format.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'audio/format.c') diff --git a/audio/format.c b/audio/format.c index 012d24b010..5b1262956c 100644 --- a/audio/format.c +++ b/audio/format.c @@ -31,24 +31,15 @@ int af_fmt2bits(int format) if (AF_FORMAT_IS_AC3(format)) return 16; if (format == AF_FORMAT_UNKNOWN) return 0; - return (format & AF_FORMAT_BITS_MASK)+8; -// return (((format & AF_FORMAT_BITS_MASK)>>3)+1) * 8; -#if 0 switch(format & AF_FORMAT_BITS_MASK) { case AF_FORMAT_8BIT: return 8; case AF_FORMAT_16BIT: return 16; case AF_FORMAT_24BIT: return 24; case AF_FORMAT_32BIT: return 32; - case AF_FORMAT_48BIT: return 48; + case AF_FORMAT_64BIT: return 64; } -#endif - return -1; -} - -int af_bits2fmt(int bits) -{ - return (bits/8 - 1) << 3; + return 0; } /* Convert format to str input str is a buffer for the @@ -96,6 +87,9 @@ const struct af_fmt_entry af_fmtstr_table[] = { { "floatle", AF_FORMAT_FLOAT_LE }, { "floatbe", AF_FORMAT_FLOAT_BE }, { "floatne", AF_FORMAT_FLOAT_NE }, + { "doublele", AF_FORMAT_DOUBLE_LE }, + { "doublebe", AF_FORMAT_DOUBLE_BE }, + { "doublene", AF_FORMAT_DOUBLE_NE }, {0} }; -- cgit v1.2.3