audio: fix af_fmt_change_bytes() with spdif formats

This could accidentally change some spdif formats to AAC (because AAC is
the first on the list and will match first). spdif formats are
inherently uninterchangeable, so treat them as their own class of
formats (like int vs. float).

Might fix some issues with ao_wasapi.c.
This commit is contained in:
wm4 2015-11-07 15:07:23 +01:00
parent b984ec52aa
commit 617aff6cda
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ int af_fmt_change_bytes(int format, int bytes)
if (af_fmt_to_bytes(fmt) == bytes &&
af_fmt_is_float(fmt) == af_fmt_is_float(format) &&
af_fmt_is_planar(fmt) == af_fmt_is_planar(format) &&
af_fmt_is_spdif(fmt) == af_fmt_is_spdif(format))
(fmt == format || (!af_fmt_is_spdif(fmt) && !af_fmt_is_spdif(format))))
return fmt;
}
return 0;