diff mbox series

[FFmpeg-devel,07/15] avcodec/mpegvideo_dec: Don't emit non-keyframe warning for H.261

Message ID GV1P250MB07370958AEEA28343F49BFB08F032@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit f48313526b5c0fb889560cb91daadd8f8c194317
Headers show
Series [FFmpeg-devel,01/15] avcodec/mpegvideo_enc: Don't update current_picture unnecessarily | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 5, 2024, 12:41 p.m. UTC
H.261 does not have keyframes (or indeed frame types) at all,
so this warning is not warranted.

Also remove an always-true check while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo_dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index 1ced9a52ed..1059aa9825 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -380,7 +380,7 @@  int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
         if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f->buf[0])
             av_log(avctx, AV_LOG_DEBUG,
                    "allocating dummy last picture for B frame\n");
-        else if (s->pict_type != AV_PICTURE_TYPE_I)
+        else if (s->codec_id != AV_CODEC_ID_H261)
             av_log(avctx, AV_LOG_ERROR,
                    "warning: first frame is no keyframe\n");