diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:28:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:28:27 +0100 |
commit | 08059f6150fcf75d884670cdbdbdf8830fa199bd (patch) | |
tree | 3e3c42784e6b34b0de16fa3fad2fbd852f59137c /libavcodec/ra144dec.c | |
parent | 65da7007043cf4fb99b72c7f823cfc15e429b45f (diff) | |
parent | 5d5c248c3df30fa91a8dde639618c985b9a11c53 (diff) | |
download | ffmpeg-08059f6150fcf75d884670cdbdbdf8830fa199bd.tar.gz |
Merge commit '5d5c248c3df30fa91a8dde639618c985b9a11c53'
* commit '5d5c248c3df30fa91a8dde639618c985b9a11c53':
s302m: decode directly to the user-provided AVFrame
ra288: decode directly to the user-provided AVFrame
ra144: decode directly to the user-provided AVFrame
ralf: decode directly to the user-provided AVFrame
qdm2: decode directly to the user-provided AVFrame
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ra144dec.c')
-rw-r--r-- | libavcodec/ra144dec.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c index b0e2498f40..61b182eb8c 100644 --- a/libavcodec/ra144dec.c +++ b/libavcodec/ra144dec.c @@ -43,9 +43,6 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx) avctx->channel_layout = AV_CH_LAYOUT_MONO; avctx->sample_fmt = AV_SAMPLE_FMT_S16; - avcodec_get_frame_defaults(&ractx->frame); - avctx->coded_frame = &ractx->frame; - return 0; } @@ -65,6 +62,7 @@ static void do_output_subblock(RA144Context *ractx, const uint16_t *lpc_coefs, static int ra144_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; static const uint8_t sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; @@ -80,12 +78,12 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data, GetBitContext gb; /* get output buffer */ - ractx->frame.nb_samples = NBLOCKS * BLOCKSIZE; - if ((ret = ff_get_buffer(avctx, &ractx->frame)) < 0) { + frame->nb_samples = NBLOCKS * BLOCKSIZE; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - samples = (int16_t *)ractx->frame.data[0]; + samples = (int16_t *)frame->data[0]; if(buf_size < FRAMESIZE) { av_log(avctx, AV_LOG_ERROR, @@ -124,8 +122,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data, FFSWAP(unsigned int *, ractx->lpc_coef[0], ractx->lpc_coef[1]); - *got_frame_ptr = 1; - *(AVFrame *)data = ractx->frame; + *got_frame_ptr = 1; return FRAMESIZE; } |