[FFmpeg-cvslog] avcodec/mpegvideo_enc: Factor new_picture unref out
Michael Niedermayer
git at videolan.org
Sun Oct 18 12:12:51 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Oct 18 11:42:32 2015 +0200| [b379e1d6dfe2d9bb7b616c63e3240c8458a205d8] | committer: Michael Niedermayer
avcodec/mpegvideo_enc: Factor new_picture unref out
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b379e1d6dfe2d9bb7b616c63e3240c8458a205d8
---
libavcodec/mpegvideo_enc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 1e8d240..938546c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1558,12 +1558,13 @@ static int select_input_picture(MpegEncContext *s)
}
}
no_output_pic:
+ ff_mpeg_unref_picture(s->avctx, &s->new_picture);
+
if (s->reordered_input_picture[0]) {
s->reordered_input_picture[0]->reference =
s->reordered_input_picture[0]->f->pict_type !=
AV_PICTURE_TYPE_B ? 3 : 0;
- ff_mpeg_unref_picture(s->avctx, &s->new_picture);
if ((ret = ff_mpeg_ref_picture(s->avctx, &s->new_picture, s->reordered_input_picture[0])))
return ret;
@@ -1604,8 +1605,6 @@ no_output_pic:
return ret;
s->picture_number = s->new_picture.f->display_picture_number;
- } else {
- ff_mpeg_unref_picture(s->avctx, &s->new_picture);
}
return 0;
}
More information about the ffmpeg-cvslog
mailing list