diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-12-23 16:50:06 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2013-02-12 12:21:21 -0500 |
commit | 0588935e64fec4e3e827ede83bc84a4a4d58733a (patch) | |
tree | 921bf851cb932a61d49baac4fb1545528cd134b0 /libavcodec/adxdec.c | |
parent | e57daa876bf0cf50782550e366e589441cd8c2bd (diff) | |
download | ffmpeg-0588935e64fec4e3e827ede83bc84a4a4d58733a.tar.gz |
adx: decode directly to the user-provided AVFrame
Diffstat (limited to 'libavcodec/adxdec.c')
-rw-r--r-- | libavcodec/adxdec.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index d8ea351858..ea40993124 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -52,9 +52,6 @@ static av_cold int adx_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16P; - avcodec_get_frame_defaults(&c->frame); - avctx->coded_frame = &c->frame; - return 0; } @@ -98,6 +95,7 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset, static int adx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { + AVFrame *frame = data; int buf_size = avpkt->size; ADXContext *c = avctx->priv_data; int16_t **samples; @@ -142,12 +140,12 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data, } /* get output buffer */ - c->frame.nb_samples = num_blocks * BLOCK_SAMPLES; - if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) { + frame->nb_samples = num_blocks * BLOCK_SAMPLES; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - samples = (int16_t **)c->frame.extended_data; + samples = (int16_t **)frame->extended_data; samples_offset = 0; while (num_blocks--) { @@ -163,8 +161,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data, samples_offset += BLOCK_SAMPLES; } - *got_frame_ptr = 1; - *(AVFrame *)data = c->frame; + *got_frame_ptr = 1; return buf - avpkt->data; } |