Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-03-30 13:34:05 +0300
committerPaul B Mahol <onemda@gmail.com>2018-03-30 13:52:54 +0300
commite30a37e95e43148f7a7d907736aaaad5bbead95e (patch)
tree698e049b05219546a1c538cb520c4534ae23a057 /libavcodec/mpc8.c
parentcc402282551d493829455fd097890cc6e2bc556a (diff)
avcodec/mpc8: get frame output buffer right before it is actually needed
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/mpc8.c')
-rw-r--r--libavcodec/mpc8.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 6347e1f691..3be2f79a5a 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -250,11 +250,6 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
int maxband, keyframe;
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;
if(keyframe){
@@ -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,
(int16_t **)frame->extended_data,
avctx->channels);