avcodec/mpegvideo_enc: Return early when getting length of B frame chain

Possible now that this is a function of its own.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2023-10-09 00:48:26 +02:00
parent 17b5fc2e51
commit b64dfe2bd1

View File

@@ -1482,8 +1482,11 @@ static int set_bframe_chain_length(MpegEncContext *s)
{ {
int i; int i;
/* Either nothing to do or can't do anything */
if (s->reordered_input_picture[0] || !s->input_picture[0])
return 0;
/* set next picture type & ordering */ /* set next picture type & ordering */
if (!s->reordered_input_picture[0] && s->input_picture[0]) {
if (s->frame_skip_threshold || s->frame_skip_factor) { if (s->frame_skip_threshold || s->frame_skip_factor) {
if (s->picture_in_gop_number < s->gop_size && if (s->picture_in_gop_number < s->gop_size &&
s->next_pic.ptr && s->next_pic.ptr &&
@@ -1599,7 +1602,6 @@ static int set_bframe_chain_length(MpegEncContext *s)
s->coded_picture_number++; s->coded_picture_number++;
} }
} }
}
return 0; return 0;
} }