summaryrefslogtreecommitdiffstats
path: root/audio/format.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-10 15:04:21 +0200
committerwm4 <wm4@nowhere>2013-05-12 21:24:57 +0200
commit9dd9ccbd8d79a7dccd93be0a1e26028ca1d89d42 (patch)
tree29710ba141b4a41550696753baa99e134e3dabe8 /audio/format.c
parentf5aec5a2a7703b18d7e5d1b83991039f3414dba8 (diff)
downloadmpv-9dd9ccbd8d79a7dccd93be0a1e26028ca1d89d42.tar.bz2
mpv-9dd9ccbd8d79a7dccd93be0a1e26028ca1d89d42.tar.xz
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.
Diffstat (limited to 'audio/format.c')
-rw-r--r--audio/format.c16
1 files changed, 5 insertions, 11 deletions
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}
};