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

Stefano Sabatini stefano.sabatini-lala
Tue Jun 2 14:15:27 CEST 2009


On date Tuesday 2009-06-02 00:30:32 +0200, Reimar D?ffinger encoded:
> Hello,
> 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 @@
>      av_init_packet(&avpkt);
>      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?

What about:

#define AV_PKT_FLAG_KEY ...
#if VERSION < NEXT
#define PKT_FLAG_KEY  AV_PKT_FLAG_KEY
#endif
?

Then we'll drop it at the next major bump.
-- 
FFmpeg = Foolish & Free Mastering Patchable Elitist Generator



More information about the ffmpeg-devel mailing list