diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-23 15:23:41 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-10-25 22:23:51 +0100 |
commit | f0a88d4d2a74534460f4a8b79c448bd5890dbd41 (patch) | |
tree | ffac0d978a8eb0237169dcad8adcaf6849376332 /libavcodec | |
parent | 533a6198505edd1379e1cd722852350ae4a85acc (diff) | |
download | ffmpeg-f0a88d4d2a74534460f4a8b79c448bd5890dbd41.tar.gz |
mpegvideo_enc: Factor new_picture unref out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index e5ff3ed70e..226a24fe2d 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1382,12 +1382,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; @@ -1428,8 +1429,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; } |