summaryrefslogtreecommitdiff
path: root/libavcodec/truespeech.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:42:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:42:14 +0100
commitdca6fb08a71b8201f0a32f9cff18e7753355733a (patch)
tree010719ea90db7d04612fcdd871870119ecb04cfb /libavcodec/truespeech.c
parent2becf21d9fd841962f87ad4e273274ee81a35bad (diff)
parentee6ca11b657515ad736ec0d2b8635e098d0a2680 (diff)
downloadffmpeg-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/truespeech.c')
-rw-r--r--libavcodec/truespeech.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index edaaea686a..fea9ae4195 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -36,7 +36,6 @@
* TrueSpeech decoder context
*/
typedef struct {
- AVFrame frame;
DSPContext dsp;
/* input data */
DECLARE_ALIGNED(16, uint8_t, buffer)[32];
@@ -73,9 +72,6 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
ff_dsputil_init(&c->dsp, avctx);
- avcodec_get_frame_defaults(&c->frame);
- avctx->coded_frame = &c->frame;
-
return 0;
}
@@ -310,6 +306,7 @@ static void truespeech_save_prevvec(TSContext *c)
static int truespeech_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;
TSContext *c = avctx->priv_data;
@@ -327,12 +324,12 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
- c->frame.nb_samples = iterations * 240;
- if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) {
+ frame->nb_samples = iterations * 240;
+ 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.data[0];
+ samples = (int16_t *)frame->data[0];
memset(samples, 0, iterations * 240 * sizeof(*samples));
@@ -354,8 +351,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data,
truespeech_save_prevvec(c);
}
- *got_frame_ptr = 1;
- *(AVFrame *)data = c->frame;
+ *got_frame_ptr = 1;
return buf_size;
}