From: Daniel Kristjansson Date: Sun, 7 Mar 2010 23:10:18 +0000 (+0000) Subject: Fix pts->dts conversion init for non-zero initial value for pts. X-Git-Tag: v0.6~835 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=663322c1b86053c56d6c25e002f4d3374d2ea085;p=platform%2Fupstream%2Flibav.git Fix pts->dts conversion init for non-zero initial value for pts. Patch by Daniel Kristjansson, danielk cuymedia net Originally committed as revision 22297 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavformat/utils.c b/libavformat/utils.c index f9d497c..d431d42 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2695,7 +2695,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ if(pkt->pts != AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY){ st->pts_buffer[0]= pkt->pts; for(i=1; ipts_buffer[i] == AV_NOPTS_VALUE; i++) - st->pts_buffer[i]= (i-delay-1) * pkt->duration; + st->pts_buffer[i]= pkt->pts + (i-delay-1) * pkt->duration; for(i=0; ipts_buffer[i] > st->pts_buffer[i+1]; i++) FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);