summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-07 15:07:23 +0100
committerwm4 <wm4@nowhere>2015-11-07 15:07:50 +0100
commit617aff6cdab6484e39cd4074111569e2f5dec9d3 (patch)
tree95f9f04a3a2ac0293c21ea51574b9c996f419473
parentb984ec52aaf569a9be4acfe6fdd056f309a3b40e (diff)
downloadmpv-617aff6cdab6484e39cd4074111569e2f5dec9d3.tar.bz2
mpv-617aff6cdab6484e39cd4074111569e2f5dec9d3.tar.xz
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.
-rw-r--r--audio/format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/format.c b/audio/format.c
index 100a0f3225..06360b884b 100644
--- a/audio/format.c
+++ b/audio/format.c
@@ -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;