Fix failure in av_read_frame on timestamp rollover.
Patch by Stephen Dredge, sdredge A tpg com au Originally committed as revision 23699 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
committed by
Carl Eugen Hoyos
parent
d1177cb589
commit
5be5d28ced
@ -1189,11 +1189,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
|
|||||||
AVPacket *next_pkt= &pktl->pkt;
|
AVPacket *next_pkt= &pktl->pkt;
|
||||||
|
|
||||||
if(genpts && next_pkt->dts != AV_NOPTS_VALUE){
|
if(genpts && next_pkt->dts != AV_NOPTS_VALUE){
|
||||||
|
int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;
|
||||||
while(pktl && next_pkt->pts == AV_NOPTS_VALUE){
|
while(pktl && next_pkt->pts == AV_NOPTS_VALUE){
|
||||||
if( pktl->pkt.stream_index == next_pkt->stream_index
|
if( pktl->pkt.stream_index == next_pkt->stream_index
|
||||||
&& next_pkt->dts < pktl->pkt.dts
|
&& (0 > av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)))
|
||||||
&& pktl->pkt.pts != pktl->pkt.dts //not b frame
|
&& av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) { //not b frame
|
||||||
/*&& pktl->pkt.dts != AV_NOPTS_VALUE*/){
|
|
||||||
next_pkt->pts= pktl->pkt.dts;
|
next_pkt->pts= pktl->pkt.dts;
|
||||||
}
|
}
|
||||||
pktl= pktl->next;
|
pktl= pktl->next;
|
||||||
|
Reference in New Issue
Block a user