aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorStephen Dredge <sdredge@tpg.com.au>2010-06-22 08:48:28 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-06-22 08:48:28 +0000
commit5be5d28ced854708a7d5c047656c7eb55d3a2a01 (patch)
treece49ec4420d3e895ea75722f32d337ebb5f4d354 /libavformat
parentd1177cb589621016f681789dd66873832d5fb14a (diff)
downloadffmpeg-5be5d28ced854708a7d5c047656c7eb55d3a2a01.tar.gz
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
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 59ca6bbde4..e33cb50661 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1189,11 +1189,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
AVPacket *next_pkt= &pktl->pkt;
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){
if( pktl->pkt.stream_index == next_pkt->stream_index
- && next_pkt->dts < pktl->pkt.dts
- && pktl->pkt.pts != pktl->pkt.dts //not b frame
- /*&& pktl->pkt.dts != AV_NOPTS_VALUE*/){
+ && (0 > av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)))
+ && av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) { //not b frame
next_pkt->pts= pktl->pkt.dts;
}
pktl= pktl->next;