ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Mon Oct  9 00:48:26 2023 +0200| [b64dfe2bd1929dc1b2633a5d392297e0c502c45e] | 
committer: Andreas Rheinhardt

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.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b64dfe2bd1929dc1b2633a5d392297e0c502c45e
---

 libavcodec/mpegvideo_enc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 60710eee98..11f3ad866b 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1482,8 +1482,11 @@ static int set_bframe_chain_length(MpegEncContext *s)
 {
     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 */
-    if (!s->reordered_input_picture[0] && s->input_picture[0]) {
         if (s->frame_skip_threshold || s->frame_skip_factor) {
             if (s->picture_in_gop_number < s->gop_size &&
                 s->next_pic.ptr &&
@@ -1599,7 +1602,6 @@ static int set_bframe_chain_length(MpegEncContext *s)
                     s->coded_picture_number++;
             }
         }
-    }
 
     return 0;
 }

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to