int samples = 0, multiplier, audio_found = 0, pce_found = 0;
int is_dmono, sce_count = 0;
int payload_alignment;
+ uint8_t che_presence[4][MAX_ELEM_ID] = {{0}};
ac->frame = data;
}
if (elem_type < TYPE_DSE) {
+ if (che_presence[elem_type][elem_id]) {
+ av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d duplicate\n",
+ elem_type, elem_id);
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+ che_presence[elem_type][elem_id] = 1;
+
if (!(che=get_che(ac, elem_type, elem_id))) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
elem_type, elem_id);
AV_PKT_DATA_JP_DUALMONO,
&jp_dualmono_size);
- if (new_extradata && 0) {
- av_free(avctx->extradata);
- avctx->extradata = av_mallocz(new_extradata_size +
- AV_INPUT_BUFFER_PADDING_SIZE);
- if (!avctx->extradata)
- return AVERROR(ENOMEM);
- avctx->extradata_size = new_extradata_size;
- memcpy(avctx->extradata, new_extradata, new_extradata_size);
- push_output_configuration(ac);
- if (decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
- avctx->extradata,
- avctx->extradata_size*8LL, 1) < 0) {
- pop_output_configuration(ac);
- return AVERROR_INVALIDDATA;
+ if (new_extradata) {
+ /* discard previous configuration */
+ ac->oc[1].status = OC_NONE;
+ err = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
+ new_extradata,
+ new_extradata_size * 8LL, 1);
+ if (err < 0) {
+ return err;
}
}