aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Fouet <benoit.fouet@free.fr>2014-10-13 14:42:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-13 17:50:20 +0200
commit4da7111eb8382c9fa5b464c0a62d12d497f7018a (patch)
tree6635d31680366637eee374218aa7c0822bb3df1a
parent0b7e5d0d75e7d8762dd04d35f8c0821736164372 (diff)
downloadffmpeg-4da7111eb8382c9fa5b464c0a62d12d497f7018a.tar.gz
avcodec/aacdec: map LFE[0] to SCE[1] for 4.0 audio.
Fixes ticket #3930 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/aacdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 10c509be82..ef820d261f 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -630,6 +630,16 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
}
case 4:
+ /* Some streams incorrectly code 4.0 audio as
+ * SCE[0] CPE[0] LFE[0]
+ * instead of
+ * SCE[0] CPE[0] SCE[1].
+ * If we seem to have encountered such a stream, transfer
+ * the SCE[1] element to the LFE[0]'s mapping */
+ if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[type][elem_id] = ac->che[TYPE_SCE][1];
+ }
if (ac->tags_mapped == 2 &&
ac->oc[1].m4ac.chan_config == 4 &&
type == TYPE_SCE) {