[libav-api] avcodec_decode_video2 return value

Chris Stankevitz chrisstankevitz at yahoo.com
Sat Mar 26 23:22:35 CET 2011


I use av_read_frame to fill an AVPacket which is passed to avcodec_decode_video2.

What do I do when avcodec_decode_video2 returns a value n that is 0 <= n < AVPacket::size?  In this case, should I increment AVPacket::data by n, decrement AVPacket::size by n, and pass the packet back into avcodec_decode_video2?

I'm used to dealing with this myself with the deprecated avcodec_decode_video.  With the deprecated approach, I controlled my buffer and felt free to things like I described in the prior paragraph.  With the new approach, I'm not sure if I can or should make such changes to AVPacket.

Thank you,



More information about the libav-api mailing list