summaryrefslogtreecommitdiff
path: root/libavcodec/mpc8.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/mpc8.c
parentafe30fe0600824b0dcda8318f09a5a4e376b99c3 (diff)
parent1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8 (diff)
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/mpc8.c')
-rw-r--r--libavcodec/mpc8.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index a6bb5801c5..489737a8c9 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -144,9 +144,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
avctx->channel_layout = (channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
avctx->channels = channels;
- avcodec_get_frame_defaults(&c->frame);
- avctx->coded_frame = &c->frame;
-
if(vlc_initialized) return 0;
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
@@ -244,6 +241,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
static int mpc8_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;
MPCContext *c = avctx->priv_data;
@@ -255,8 +253,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
int last[2];
/* get output buffer */
- c->frame.nb_samples = MPC_FRAME_SIZE;
- if ((res = ff_get_buffer(avctx, &c->frame)) < 0) {
+ frame->nb_samples = MPC_FRAME_SIZE;
+ if ((res = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
}
@@ -415,7 +413,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
}
ff_mpc_dequantize_and_synth(c, maxband - 1,
- (int16_t **)c->frame.extended_data,
+ (int16_t **)frame->extended_data,
avctx->channels);
c->cur_frame++;
@@ -426,8 +424,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
if(c->cur_frame >= c->frames)
c->cur_frame = 0;
- *got_frame_ptr = 1;
- *(AVFrame *)data = c->frame;
+ *got_frame_ptr = 1;
return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
}