diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:42:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:42:14 +0100 |
commit | dca6fb08a71b8201f0a32f9cff18e7753355733a (patch) | |
tree | 010719ea90db7d04612fcdd871870119ecb04cfb /libavcodec/twinvq.c | |
parent | 2becf21d9fd841962f87ad4e273274ee81a35bad (diff) | |
parent | ee6ca11b657515ad736ec0d2b8635e098d0a2680 (diff) | |
download | ffmpeg-dca6fb08a71b8201f0a32f9cff18e7753355733a.tar.gz |
Merge commit 'ee6ca11b657515ad736ec0d2b8635e098d0a2680'
* commit 'ee6ca11b657515ad736ec0d2b8635e098d0a2680':
vorbis: decode directly to the user-provided AVFrame
vmdaudio: decode directly to the user-provided AVFrame
twinvq: decode directly to the user-provided AVFrame
tta: decode directly to the user-provided AVFrame
truespeech: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/tta.c
libavcodec/twinvq.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/twinvq.c')
-rw-r--r-- | libavcodec/twinvq.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 8bb44cce29..51a4478825 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -177,7 +177,6 @@ static const ModeTab mode_44_48 = { typedef struct TwinContext { AVCodecContext *avctx; - AVFrame frame; AVFloatDSPContext fdsp; FFTContext mdct_ctx[3]; @@ -811,6 +810,7 @@ static void read_and_decode_spectrum(TwinContext *tctx, GetBitContext *gb, static int twin_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; TwinContext *tctx = avctx->priv_data; @@ -832,12 +832,12 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data, /* get output buffer */ if (tctx->discarded_packets >= 2) { - tctx->frame.nb_samples = mtab->size; - if ((ret = ff_get_buffer(avctx, &tctx->frame)) < 0) { + frame->nb_samples = mtab->size; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - out = (float **)tctx->frame.extended_data; + out = (float **)frame->extended_data; } init_get_bits(&gb, buf, buf_size * 8); @@ -863,8 +863,7 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data, return buf_size; } - *got_frame_ptr = 1; - *(AVFrame *)data = tctx->frame; + *got_frame_ptr = 1; return buf_size; } @@ -1171,9 +1170,6 @@ static av_cold int twin_decode_init(AVCodecContext *avctx) memset_float(tctx->bark_hist[0][0], 0.1, FF_ARRAY_ELEMS(tctx->bark_hist)); - avcodec_get_frame_defaults(&tctx->frame); - avctx->coded_frame = &tctx->frame; - return 0; } |