aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-30 01:45:11 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-30 01:45:11 +0200
commit259292f9d484f31812a6ecbf4bfd3efd7c5905fd (patch)
treee185294adb18111ab623b5064a640bf47d82d4eb
parent24b4e6c373f8f942b2417d3cfed508c065b9d69e (diff)
downloadffmpeg-259292f9d484f31812a6ecbf4bfd3efd7c5905fd.tar.gz
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>
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 00ced1f926..6ace50143f 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1593,7 +1593,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
int h_chroma_shift, v_chroma_shift;
av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
&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,
"warning: first frame is no keyframe\n");
else if (s->picture_structure != PICT_FRAME)