lavf: use input keyframe flag when muxer does not provide keyframe flags.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 2 Jun 2012 19:11:43 +0000 (21:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 2 Jun 2012 19:11:43 +0000 (21:11 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index e7fd04a..ca97b91 100644 (file)
@@ -1207,6 +1207,9 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
              st->parser->pict_type == AV_PICTURE_TYPE_I))
             out_pkt.flags |= AV_PKT_FLAG_KEY;
 
+        if(st->parser->key_frame == -1 && st->parser->pict_type==AV_PICTURE_TYPE_NONE && (pkt->flags&AV_PKT_FLAG_KEY))
+            out_pkt.flags |= AV_PKT_FLAG_KEY;
+
         compute_pkt_fields(s, st, st->parser, &out_pkt);
 
         if ((s->iformat->flags & AVFMT_GENERIC_INDEX) &&