diff utils.c @ 4539:54fded221fb1 libavformat

Add key_frame to AVCodecParserContext, used in libavformat. Initialized to -1 in parser.c for backward compatibility. Patch by Ivan Schreter, schreter gmx net
author cehoyos
date Wed, 18 Feb 2009 23:46:05 +0000
parents f6b8d1584348
children 617f07022319
line wrap: on
line diff
--- a/utils.c	Wed Feb 18 14:01:46 2009 +0000
+++ b/utils.c	Wed Feb 18 23:46:05 2009 +0000
@@ -904,8 +904,10 @@
     else if (pc) {
         pkt->flags = 0;
         /* keyframe computation */
-            if (pc->pict_type == FF_I_TYPE)
-                pkt->flags |= PKT_FLAG_KEY;
+        if (pc->key_frame == 1)
+            pkt->flags |= PKT_FLAG_KEY;
+        else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE)
+            pkt->flags |= PKT_FLAG_KEY;
     }
 }