aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-07-30 11:06:43 -0300
committerJames Almer <jamrial@gmail.com>2022-08-01 20:25:09 -0300
commitdb9fd78bd7562da7cd5d91f268b28b78a1824d03 (patch)
treeefe3a31aa90662989a96e0197911b7fb576382cf
parent9fb80bf760f0a74000f7f50b2080d519eee970fd (diff)
downloadffmpeg-db9fd78bd7562da7cd5d91f268b28b78a1824d03.tar.gz
avcodec/aacdec_fixed: also clip samples on the second channel for stereo HE-AAC
Fixes outputting silence on the second channel when decoding Parametic Stereo HE-AAC. Closes ticekt #3361. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/aacdec_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 4266d89c6d..149c171c83 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -3095,7 +3095,7 @@ static void spectral_to_sample(AACContext *ac, int samples)
/* preparation for resampler */
for(j = 0; j<samples; j++){
che->ch[0].ret[j] = (int32_t)av_clip64((int64_t)che->ch[0].ret[j]*128, INT32_MIN, INT32_MAX-0x8000)+0x8000;
- if(type == TYPE_CPE)
+ if (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))
che->ch[1].ret[j] = (int32_t)av_clip64((int64_t)che->ch[1].ret[j]*128, INT32_MIN, INT32_MAX-0x8000)+0x8000;
}
}