diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 11:18:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 11:27:54 +0100 |
commit | 4789955ec4260f9e8f99b8d774ada2ad679d5630 (patch) | |
tree | b94dfe29f21daf81a3fe5d759e093c26de7be7e3 /libavcodec/aacdec.c | |
parent | 2acd5fb5532587507ab197788338ae55bf9128aa (diff) | |
parent | e57daa876bf0cf50782550e366e589441cd8c2bd (diff) | |
download | ffmpeg-4789955ec4260f9e8f99b8d774ada2ad679d5630.tar.gz |
Merge commit 'e57daa876bf0cf50782550e366e589441cd8c2bd'
* commit 'e57daa876bf0cf50782550e366e589441cd8c2bd':
adpcm: decode directly to the user-provided AVFrame
ac3: decode directly to the user-provided AVFrame
aac: decode directly to the user-provided AVFrame
8svx: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/8svx.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index d4ea115cd5..64827872f1 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -187,8 +187,8 @@ static int frame_configure_elements(AVCodecContext *avctx) } /* 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; } @@ -196,7 +196,7 @@ static int frame_configure_elements(AVCodecContext *avctx) /* 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; @@ -964,9 +964,6 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) cbrt_tableinit(); - avcodec_get_frame_defaults(&ac->frame); - avctx->coded_frame = &ac->frame; - return 0; } @@ -2484,6 +2481,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data, int samples = 0, multiplier, audio_found = 0, pce_found = 0; int is_dmono, sce_count = 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"); @@ -2604,10 +2603,8 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data, is_dmono = ac->dmono_mode && sce_count == 2 && ac->oc[1].channel_layout == (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT); - if (samples) { - ac->frame.nb_samples = samples; - *(AVFrame *)data = ac->frame; - } + if (samples) + ac->frame->nb_samples = samples; *got_frame_ptr = !!samples; if (is_dmono) { |