summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_lavc.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-06-16 03:12:44 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2022-09-02 01:27:31 +0200
commit9be52e5dd8d5b4ae56dfd68430191c818f646beb (patch)
treef341b8121532e07205c4da16a9d4312c4669aeda /audio/decode/ad_lavc.c
parent04062b6f897960938649047c3e2c5ceb08bae295 (diff)
downloadmpv-9be52e5dd8d5b4ae56dfd68430191c818f646beb.tar.bz2
mpv-9be52e5dd8d5b4ae56dfd68430191c818f646beb.tar.xz
ad_lavc: strip non-normalized floats
`opus` codec likes returning denormalized floats in some cases, causing wacky issues. Fixes #10290
Diffstat (limited to 'audio/decode/ad_lavc.c')
-rw-r--r--audio/decode/ad_lavc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index 34c3a183eb..6ae7d80bf5 100644
--- a/audio/decode/ad_lavc.c
+++ b/audio/decode/ad_lavc.c
@@ -260,6 +260,9 @@ static int receive_frame(struct mp_filter *da, struct mp_frame *out)
priv->trim_samples -= trim;
}
+ // Strip possibly bogus float values like Infinity, NaN, denormalized
+ mp_aframe_sanitize_float(mpframe);
+
if (mp_aframe_get_size(mpframe) > 0) {
*out = MAKE_FRAME(MP_FRAME_AUDIO, mpframe);
} else {