aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/adxdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:36:28 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:39:05 +0100
commitd13f434dbb55348b3ed761e4f4c2ff9c7be4ea4b (patch)
tree6591e3d29559c2dacdea43049b128790993be84c /libavcodec/adxdec.c
parent4789955ec4260f9e8f99b8d774ada2ad679d5630 (diff)
parente3db34291f4401a16f6ac92721617a9f33cd4c31 (diff)
downloadffmpeg-d13f434dbb55348b3ed761e4f4c2ff9c7be4ea4b.tar.gz
Merge commit 'e3db34291f4401a16f6ac92721617a9f33cd4c31'
* commit 'e3db34291f4401a16f6ac92721617a9f33cd4c31': amrnb: decode directly to the user-provided AVFrame als: decode directly to the user-provided AVFrame alac: decode directly to the user-provided AVFrame adxenc: alloc/free coded_frame instead of keeping it in the ADXContext adx: decode directly to the user-provided AVFrame Conflicts: libavcodec/alsdec.c libavcodec/amrnbdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adxdec.c')
-rw-r--r--libavcodec/adxdec.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 0130628af7..aebf6910c9 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;
@@ -143,12 +141,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--) {
@@ -164,8 +162,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;
}