if (avctx->error_recognition >= FF_ER_CAREFUL) {
s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
if (!s->input_buffer)
- return AVERROR_NOMEM;
+ return AVERROR(ENOMEM);
}
avctx->sample_fmt = SAMPLE_FMT_S16;
}
/* apply spectral extension to high frequency bins */
- if (s->spx_in_use) {
+ if (s->spx_in_use && CONFIG_EAC3_DECODER) {
ff_eac3_apply_spectral_extension(s);
}
out_samples += 256 * s->out_channels;
}
*data_size = s->num_blocks * 256 * avctx->channels * sizeof (int16_t);
- return s->frame_size;
+ return FFMIN(buf_size, s->frame_size);
}
/**