summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec_template.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2017-02-09 08:58:47 -0800
committerAlex Converse <alex.converse@gmail.com>2017-02-13 09:31:13 -0800
commit1fce67d6403a4540181f6ed05abf5b3edd4ef014 (patch)
tree54eae237c02a54c0543def6c41dc8916a2dff389 /libavcodec/aacdec_template.c
parent3bb24fc344f0e8448b3c6826193e8ee43f7d984d (diff)
downloadffmpeg-streaming-1fce67d6403a4540181f6ed05abf5b3edd4ef014.zip
ffmpeg-streaming-1fce67d6403a4540181f6ed05abf5b3edd4ef014.tar.gz
aac_latm: Align inband PCE to the start of the payload
A strict reading of the spec seems to imply that it should be aligned to the start of the element instance tag, but that would break all of the samples with PCEs. It seems like a well formed LATM stream should have its PCE in the ASC rather than inband. Fixes ticket 4544
Diffstat (limited to 'libavcodec/aacdec_template.c')
-rw-r--r--libavcodec/aacdec_template.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index d980ae0..fd6a0f1 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -2949,6 +2949,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int err, elem_id;
int samples = 0, multiplier, audio_found = 0, pce_found = 0;
int is_dmono, sce_count = 0;
+ int payload_alignment;
ac->frame = data;
@@ -2971,6 +2972,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
// This may lead to an undefined profile being signaled
ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
+ payload_alignment = get_bits_count(gb);
ac->tags_mapped = 0;
// parse
while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
@@ -3025,7 +3027,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
uint8_t layout_map[MAX_ELEM_ID*4][3];
int tags;
push_output_configuration(ac);
- tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb, 0);
+ tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb,
+ payload_alignment);
if (tags < 0) {
err = tags;
break;
OpenPOWER on IntegriCloud