(转自:https://www.cnblogs.com/highway-9/p/5595101.html)
一、avformat.h里面增加int av_read_frame_aozhen(AVFormatContext *s, AVPacket *pkt)函数:
并且在对应实现文件utils.c里面对其实现:
二、avcodec.h里面的AVPacket结构体增加成员变量int nIsLostPackets:
并且在avpacket.c里面的av_init_packets函数里面对其初始化:
三、utils.c里面read_frame_internal函数增加临时变量int nIsLostPackets = 0,read_frame_internal函数调用ff_read_packet的后一句增加nIsLostPackets = cur_pkt.nIsLostPackets:
并且在函数末尾将nIsLostPackets赋值给pkt->nIsLostPackets:
四、在rtpdec.c的rtp_parse_queued_packet函数里面增加丢包判断的代码: