mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-27 05:38:07 +00:00
mpegvideo_enc: Factor new_picture unref out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
533a619850
commit
f0a88d4d2a
@ -1382,12 +1382,13 @@ static int select_input_picture(MpegEncContext *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
no_output_pic:
|
no_output_pic:
|
||||||
|
ff_mpeg_unref_picture(s->avctx, &s->new_picture);
|
||||||
|
|
||||||
if (s->reordered_input_picture[0]) {
|
if (s->reordered_input_picture[0]) {
|
||||||
s->reordered_input_picture[0]->reference =
|
s->reordered_input_picture[0]->reference =
|
||||||
s->reordered_input_picture[0]->f->pict_type !=
|
s->reordered_input_picture[0]->f->pict_type !=
|
||||||
AV_PICTURE_TYPE_B ? 3 : 0;
|
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])))
|
if ((ret = ff_mpeg_ref_picture(s->avctx, &s->new_picture, s->reordered_input_picture[0])))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -1428,8 +1429,6 @@ no_output_pic:
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
s->picture_number = s->new_picture.f->display_picture_number;
|
s->picture_number = s->new_picture.f->display_picture_number;
|
||||||
} else {
|
|
||||||
ff_mpeg_unref_picture(s->avctx, &s->new_picture);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user