aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-20 11:29:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-20 11:29:43 +0200
commitfc83ff80b4380ad6ec8c14dbbd8a65a942b917cb (patch)
tree1b9999a27f951dd24e0961493434043fbd57ba77
parent924a77fb4e828587c7db6a27dbb009e112396776 (diff)
parent3d71b1f8f09fccea7158e868fb9bd81b81205449 (diff)
downloadffmpeg-fc83ff80b4380ad6ec8c14dbbd8a65a942b917cb.tar.gz
Merge commit '3d71b1f8f09fccea7158e868fb9bd81b81205449'
* commit '3d71b1f8f09fccea7158e868fb9bd81b81205449': mpegvideo_enc: Simplify picture allocation Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegvideo_enc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 6194366b4d..a4d7506019 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1143,14 +1143,12 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
if (direct) {
if ((ret = av_frame_ref(pic->f, pic_arg)) < 0)
return ret;
- if (ff_alloc_picture(s, pic, 1) < 0) {
- return -1;
- }
- } else {
- if (ff_alloc_picture(s, pic, 0) < 0) {
- return -1;
- }
+ }
+ ret = ff_alloc_picture(s, pic, direct);
+ if (ret < 0)
+ return ret;
+ if (!direct) {
if (pic->f->data[0] + INPLACE_OFFSET == pic_arg->data[0] &&
pic->f->data[1] + INPLACE_OFFSET == pic_arg->data[1] &&
pic->f->data[2] + INPLACE_OFFSET == pic_arg->data[2]) {