Commit e30a37e9 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/mpc8: get frame output buffer right before it is actually needed

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent cc402282
...@@ -250,11 +250,6 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data, ...@@ -250,11 +250,6 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
int maxband, keyframe; int maxband, keyframe;
int last[2]; int last[2];
/* get output buffer */
frame->nb_samples = MPC_FRAME_SIZE;
if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
return res;
keyframe = c->cur_frame == 0; keyframe = c->cur_frame == 0;
if(keyframe){ if(keyframe){
...@@ -415,6 +410,10 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data, ...@@ -415,6 +410,10 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
} }
} }
frame->nb_samples = MPC_FRAME_SIZE;
if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
return res;
ff_mpc_dequantize_and_synth(c, maxband - 1, ff_mpc_dequantize_and_synth(c, maxband - 1,
(int16_t **)frame->extended_data, (int16_t **)frame->extended_data,
avctx->channels); avctx->channels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment