audio/format: reformat

This commit is contained in:
wm4 2013-11-07 22:12:26 +01:00
parent 6c4b504eca
commit aa48eeac97
2 changed files with 55 additions and 57 deletions

View File

@ -31,8 +31,7 @@ int af_fmt2bits(int format)
if (AF_FORMAT_IS_AC3(format)) return 16;
if (format == AF_FORMAT_UNKNOWN)
return 0;
switch(format & AF_FORMAT_BITS_MASK)
{
switch (format & AF_FORMAT_BITS_MASK) {
case AF_FORMAT_8BIT: return 8;
case AF_FORMAT_16BIT: return 16;
case AF_FORMAT_24BIT: return 24;
@ -122,11 +121,10 @@ bool af_fmt_is_valid(int format)
const char *af_fmt2str_short(int format)
{
int i;
for (i = 0; af_fmtstr_table[i].name; i++)
for (int i = 0; af_fmtstr_table[i].name; i++) {
if (af_fmtstr_table[i].format == format)
return af_fmtstr_table[i].name;
}
return "??";
}
@ -143,9 +141,9 @@ int af_fmt_seconds_to_bytes(int format, float seconds, int channels, int sampler
int af_str2fmt_short(bstr str)
{
for (int i = 0; af_fmtstr_table[i].name; i++)
for (int i = 0; af_fmtstr_table[i].name; i++) {
if (!bstrcasecmp0(str, af_fmtstr_table[i].name))
return af_fmtstr_table[i].format;
}
return 0;
}