}
/* get output buffer */
- ac->frame.nb_samples = 2048;
- if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
+ ac->frame->nb_samples = 2048;
+ if ((ret = ff_get_buffer(avctx, ac->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
/* map output channel pointers to AVFrame data */
for (ch = 0; ch < avctx->channels; ch++) {
if (ac->output_element[ch])
- ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch];
+ ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
}
return 0;
cbrt_tableinit();
- avcodec_get_frame_defaults(&ac->frame);
- avctx->coded_frame = &ac->frame;
-
return 0;
}
int err, elem_id;
int samples = 0, multiplier, audio_found = 0, pce_found = 0;
+ ac->frame = data;
+
if (show_bits(gb, 12) == 0xfff) {
if (parse_adts_frame_header(ac, gb) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
samples <<= multiplier;
- if (samples) {
- ac->frame.nb_samples = samples;
- *(AVFrame *)data = ac->frame;
- }
+ if (samples)
+ ac->frame->nb_samples = samples;
*got_frame_ptr = !!samples;
if (ac->oc[1].status && audio_found) {