mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 20:27:23 +00:00
audio/format: reformat
This commit is contained in:
parent
6c4b504eca
commit
aa48eeac97
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user