diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:14:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:14:46 +0100 |
commit | afe30fe0600824b0dcda8318f09a5a4e376b99c3 (patch) | |
tree | 06921b98421767cea958eed3943b10fb71e4997d /libavcodec/libgsm.c | |
parent | 5459cf411412c7a1d2da7ce6a6955c7d57490a55 (diff) | |
parent | 86bfcfcf2364bc837b7bb582c66a8a15a332414f (diff) | |
download | ffmpeg-afe30fe0600824b0dcda8318f09a5a4e376b99c3.tar.gz |
Merge commit '86bfcfcf2364bc837b7bb582c66a8a15a332414f'
* commit '86bfcfcf2364bc837b7bb582c66a8a15a332414f':
mace: decode directly to the user-provided AVFrame
libspeex: decode directly to the user-provided AVFrame
libopus: decode directly to the user-provided AVFrame
libopencore-amr: decode directly to the user-provided AVFrame
libgsm: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/libopusdec.c
libavcodec/mace.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libgsm.c')
-rw-r--r-- | libavcodec/libgsm.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index fd476e02e2..470cd61e0e 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -152,7 +152,6 @@ AVCodec ff_libgsm_ms_encoder = { #endif typedef struct LibGSMDecodeContext { - AVFrame frame; struct gsm_state *state; } LibGSMDecodeContext; @@ -180,9 +179,6 @@ static av_cold int libgsm_decode_init(AVCodecContext *avctx) { } } - avcodec_get_frame_defaults(&s->frame); - avctx->coded_frame = &s->frame; - return 0; } @@ -199,6 +195,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data, { int i, ret; LibGSMDecodeContext *s = avctx->priv_data; + AVFrame *frame = data; uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int16_t *samples; @@ -209,12 +206,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data, } /* get output buffer */ - s->frame.nb_samples = avctx->frame_size; - if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) { + frame->nb_samples = avctx->frame_size; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - samples = (int16_t *)s->frame.data[0]; + samples = (int16_t *)frame->data[0]; for (i = 0; i < avctx->frame_size / GSM_FRAME_SIZE; i++) { if ((ret = gsm_decode(s->state, buf, samples)) < 0) @@ -223,8 +220,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data, samples += GSM_FRAME_SIZE; } - *got_frame_ptr = 1; - *(AVFrame *)data = s->frame; + *got_frame_ptr = 1; return avctx->block_align; } |