[FFmpeg-devel] [PATCH] avcodec_decode_video must set PKT_FLAG_KEY

Reimar Döffinger Reimar.Doeffinger
Tue Jun 2 00:30:32 CEST 2009

with avcodec_decode_video MPNG videos decode to a total mess, since it
does not set PKT_FLAG_KEY and thus all consecutive frames are
interpreted as delta frames.
Following patch fixes that, of course CorePNG support is not possible
like that.

Index: libavcodec/utils.c
--- libavcodec/utils.c  (revision 19072)
+++ libavcodec/utils.c  (working copy)
@@ -557,6 +557,8 @@
     avpkt.data = buf;
     avpkt.size = buf_size;
+    // HACK for CorePNG to decode as normal PNG by default
+    avpkt.flags = PKT_FLAG_KEY;
     return avcodec_decode_video2(avctx, picture, got_picture_ptr, &avpkt);

But there is another issue: PKT_FLAG_KEY was made part of the public API
it seems (if it isn't it needs to be made, otherwise MPNG can no longer
be decoded correctly), but it hasn't been given the correct AV_ prefix,
what to do about that?

More information about the ffmpeg-devel mailing list