// NOTE(fox): Even though each layer has its own completely isolated AV // instance, it appears two layers with the same file still share something. // When the layers aren't at the same position in time, the playhead of one // layer gets misaligned every few frames and causes a manual seek back to the // position. Different files don't exhibit this behavior. struct av_stream_info { uint32 Index; AVCodecParameters *CodecParameters; // Used to supply info about the decoder. const AVCodec* Codec; AVStream *Stream; // Which stream, or channel, the video is in. Holds FPS info and is used to verify that the decoded packet belongs to this stream. AVCodecContext *CodecContext; }; struct av_info { uint8 Occupied; uint16 Block_Source_Index; int LastFrameRendered; // Convenient to know this to only seek when we actually need to. uint64 PreviousPTS; // PTS value of the previous frame, used to check timings in debug. AVFormatContext *FileFormatContext; // Umbrella for everything else, seems to contain the playhead state av_stream_info Video; av_stream_info Audio; AVPacket *Packet; AVFrame *Frame; real32 SecondCount; uint64 PTSDuration; // likely not always 100% accurate SwsContext *RGBContext; };