Browse Source

Merge commit 'bc76c46943272515805d7ac48ca39f14826d1fed'

* commit 'bc76c46943272515805d7ac48ca39f14826d1fed':
  aac: Wait to know the channels before allocating frame

Conflicts:
	libavcodec/aacdec.c

See: 676a395ab9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.7
Michael Niedermayer 10 years ago
parent
commit
153d23ee39
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavcodec/aacdec.c

+ 8
- 0
libavcodec/aacdec.c View File

@@ -2987,6 +2987,9 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if (avctx->debug & FF_DEBUG_STARTCODE) if (avctx->debug & FF_DEBUG_STARTCODE)
av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id); av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);


if (!avctx->channels && elem_type != TYPE_PCE)
goto fail;

if (elem_type < TYPE_DSE) { if (elem_type < TYPE_DSE) {
if (!(che=get_che(ac, elem_type, elem_id))) { if (!(che=get_che(ac, elem_type, elem_id))) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n", av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
@@ -3076,6 +3079,11 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
} }
} }


if (!avctx->channels) {
*got_frame_ptr = 0;
return 0;
}

spectral_to_sample(ac); spectral_to_sample(ac);


multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0; multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;


Loading…
Cancel
Save