From 7f8582dfc635334de7f6fc10c78d45a02dfd1104 Mon Sep 17 00:00:00 2001 From: David Conrad Date: Wed, 5 Sep 2007 00:25:40 +0000 Subject: [PATCH] Make sure that the calculated duration doesn't decrease Originally committed as revision 10374 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroskaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index fcb3470d03..7fba6af3ae 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -748,7 +748,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) if (ret < 0) return ret; } - mkv->duration = pkt->pts + pkt->duration; + mkv->duration = FFMAX(mkv->duration, pkt->pts + pkt->duration); return 0; }