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

Reimar Döffinger Reimar.Doeffinger
Wed Jun 3 14:04:31 CEST 2009


On Wed, Jun 03, 2009 at 12:34:31PM +0200, Michael Niedermayer wrote:
> On Tue, Jun 02, 2009 at 12:30:32AM +0200, Reimar D?ffinger wrote:
> > 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);
> >  }
> 
> ok

Applied.

> > 
> > 
> > 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?
> 
> yes

Hm. "yes" doesn't make much sense here. I took it to mean you are ok
with the suggestion of adding AV_PKT_FLAG_KEY and deprecating the old
one.



More information about the ffmpeg-devel mailing list