summaryrefslogtreecommitdiff
path: root/libavcodec/nellymoserdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:21:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:22:35 +0100
commit65da7007043cf4fb99b72c7f823cfc15e429b45f (patch)
treebaf5a652e66f919f462cc80c6d8fe0d247788475 /libavcodec/nellymoserdec.c
parentafe30fe0600824b0dcda8318f09a5a4e376b99c3 (diff)
parent1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8 (diff)
downloadffmpeg-65da7007043cf4fb99b72c7f823cfc15e429b45f.tar.gz
Merge commit '1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8'
* commit '1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8': qcelp: decode directly to the user-provided AVFrame pcm-bluray: decode directly to the user-provided AVFrame nellymoser: decode directly to the user-provided AVFrame mpc7/8: decode directly to the user-provided AVFrame mpegaudio: decode directly to the user-provided AVFrame mlp/truehd: decode directly to the user-provided AVFrame Conflicts: libavcodec/mpc7.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/nellymoserdec.c')
-rw-r--r--libavcodec/nellymoserdec.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index ad3158ce3b..b57df30f0c 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -49,7 +49,6 @@
typedef struct NellyMoserDecodeContext {
AVCodecContext* avctx;
- AVFrame frame;
AVLFG random_state;
GetBitContext gb;
float scale_bias;
@@ -136,15 +135,13 @@ static av_cold int decode_init(AVCodecContext * avctx) {
avctx->channels = 1;
avctx->channel_layout = AV_CH_LAYOUT_MONO;
- avcodec_get_frame_defaults(&s->frame);
- avctx->coded_frame = &s->frame;
-
return 0;
}
static int decode_tag(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
+ AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
const uint8_t *side=av_packet_get_side_data(avpkt, 'F', NULL);
int buf_size = avpkt->size;
@@ -174,12 +171,12 @@ static int decode_tag(AVCodecContext *avctx, void *data,
avctx->sample_rate= 11025*(blocks/2);
/* get output buffer */
- s->frame.nb_samples = NELLY_SAMPLES * blocks;
- if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
+ frame->nb_samples = NELLY_SAMPLES * blocks;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- samples_flt = (float *)s->frame.data[0];
+ samples_flt = (float *)frame->data[0];
for (i=0 ; i<blocks ; i++) {
nelly_decode_block(s, buf, samples_flt);
@@ -187,8 +184,7 @@ static int decode_tag(AVCodecContext *avctx, void *data,
buf += NELLY_BLOCK_LEN;
}
- *got_frame_ptr = 1;
- *(AVFrame *)data = s->frame;
+ *got_frame_ptr = 1;
return buf_size;
}