avcodec: force intra (H.263, H.264) frame request if no key frame received
@@ -278,6 +278,9 @@ int decode_h264(struct viddec_state *st, struct vidframe *frame,
if (err)
return err;
+ if (!h264_is_keyframe(h264_hdr.type) && !st->got_keyframe)
+ return EPROTO;
+
#if 0
re_printf("avcodec: decode: %s %s type=%2d %s \n",
marker ? "[M]" : " ",
@@ -481,6 +484,9 @@ int decode_h263(struct viddec_state *st, struct vidframe *frame,
if (err)
return err;
+ if (hdr.i && !st->got_keyframe)
+ return EPROTO;
+
#if 0
debug(".....[%s seq=%5u ] MODE %s -"
" SBIT=%u EBIT=%u I=%s"
