According to the text in avcodec.h file, there are some decoders may support multiple frames in one AVPacket, but avcodec_decode_video2 method decode only first frame… I must get all of them.
In source code of libavcodec, parameter AVPacket noticed as const AVPacket *avpacket, so while decoding this packet decoder cant change AVPacket’s fields, can I change maybe an offset of packet data or delete already recived data for making decoder read in loop all frames in the packet???
I don’t think that can even happen anymore, but basically you would do something like this: