1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/mpegvideo: Dont incorrectly warn about missing keyframes

Files starting with B frames in presentation order generated the
"no keyframe" warning before this change.

Based on patch by: Robert Krüger <krueger@lesspain.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-30 01:45:11 +02:00
parent 24b4e6c373
commit 259292f9d4

View File

@ -1593,7 +1593,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
int h_chroma_shift, v_chroma_shift; int h_chroma_shift, v_chroma_shift;
av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
&h_chroma_shift, &v_chroma_shift); &h_chroma_shift, &v_chroma_shift);
if (s->pict_type != AV_PICTURE_TYPE_I) if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr && s->next_picture_ptr->f.data[0])
av_log(avctx, AV_LOG_INFO,
"allocating dummy last picture for B frame\n");
else if (s->pict_type != AV_PICTURE_TYPE_I)
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"warning: first frame is no keyframe\n"); "warning: first frame is no keyframe\n");
else if (s->picture_structure != PICT_FRAME) else if (s->picture_structure != PICT_FRAME)