diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 11:45:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 11:45:25 +0100 |
commit | f03cdbd0454fbdba53a123a8f95186a519fade8d (patch) | |
tree | c7386c765f42c684b931dcefb6382d4aadf43e5a /libavcodec/atrac3.c | |
parent | d13f434dbb55348b3ed761e4f4c2ff9c7be4ea4b (diff) | |
parent | 5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20 (diff) | |
download | ffmpeg-f03cdbd0454fbdba53a123a8f95186a519fade8d.tar.gz |
Merge commit '5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20'
* commit '5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20':
binkaudio: decode directly to the user-provided AVFrame
atrac3: decode directly to the user-provided AVFrame
atrac1: decode directly to the user-provided AVFrame
ape: decode directly to the user-provided AVFrame
amrwb: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/amrwbdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r-- | libavcodec/atrac3.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index c43de719c6..6216536363 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -87,7 +87,6 @@ typedef struct ChannelUnit { } ChannelUnit; typedef struct ATRAC3Context { - AVFrame frame; GetBitContext gb; //@{ /** stream data */ @@ -799,6 +798,7 @@ static int decode_frame(AVCodecContext *avctx, const uint8_t *databuf, static int atrac3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { + AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ATRAC3Context *q = avctx->priv_data; @@ -812,8 +812,8 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data, } /* get output buffer */ - q->frame.nb_samples = SAMPLES_PER_FRAME; - if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) { + frame->nb_samples = SAMPLES_PER_FRAME; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } @@ -826,14 +826,13 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data, databuf = buf; } - ret = decode_frame(avctx, databuf, (float **)q->frame.extended_data); + ret = decode_frame(avctx, databuf, (float **)frame->extended_data); if (ret) { av_log(NULL, AV_LOG_ERROR, "Frame decoding error!\n"); return ret; } - *got_frame_ptr = 1; - *(AVFrame *)data = q->frame; + *got_frame_ptr = 1; return avctx->block_align; } @@ -997,9 +996,6 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } - avcodec_get_frame_defaults(&q->frame); - avctx->coded_frame = &q->frame; - return 0; } |