diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:05:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:05:00 +0100 |
commit | 5459cf411412c7a1d2da7ce6a6955c7d57490a55 (patch) | |
tree | 18117251ae2ca34fd6895998f9699ef09855427a /libavcodec/libilbc.c | |
parent | d88e674a15dc23ca6bb68173dbb7c12e5d668bb5 (diff) | |
parent | a8ea936a0a00570f61a16a588821b52f6a3115c2 (diff) | |
download | ffmpeg-5459cf411412c7a1d2da7ce6a6955c7d57490a55.tar.gz |
Merge commit 'a8ea936a0a00570f61a16a588821b52f6a3115c2'
* commit 'a8ea936a0a00570f61a16a588821b52f6a3115c2':
libilbc: decode directly to the user-provided AVFrame
dpcm: decode directly to the user-provided AVFrame
imc/iac: decode directly to the user-provided AVFrame
gsm: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/dpcm.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libilbc.c')
-rw-r--r-- | libavcodec/libilbc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index f9e286c7ed..56cb51fb44 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -41,7 +41,6 @@ static int get_mode(AVCodecContext *avctx) typedef struct ILBCDecContext { const AVClass *class; - AVFrame frame; iLBC_Dec_Inst_t decoder; int enhance; } ILBCDecContext; @@ -69,8 +68,6 @@ static av_cold int ilbc_decode_init(AVCodecContext *avctx) } WebRtcIlbcfix_InitDecode(&s->decoder, mode, s->enhance); - avcodec_get_frame_defaults(&s->frame); - avctx->coded_frame = &s->frame; avctx->channels = 1; avctx->channel_layout = AV_CH_LAYOUT_MONO; @@ -86,6 +83,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ILBCDecContext *s = avctx->priv_data; + AVFrame *frame = data; int ret; if (s->decoder.no_of_bytes > buf_size) { @@ -94,17 +92,16 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - s->frame.nb_samples = s->decoder.blockl; - if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) { + frame->nb_samples = s->decoder.blockl; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) s->frame.data[0], + WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0], (const WebRtc_UWord16*) buf, &s->decoder, 1); - *got_frame_ptr = 1; - *(AVFrame *)data = s->frame; + *got_frame_ptr = 1; return s->decoder.no_of_bytes; } |