# HG changeset patch # User conrad # Date 1188951940 0 # Node ID 81b1f6c373b475ae511b331a9f234f05c4e64265 # Parent 39c0db7c20bec19a3aaec1b62fefe1312b751ed8 Make sure that the calculated duration doesn't decrease diff -r 39c0db7c20be -r 81b1f6c373b4 matroskaenc.c --- a/matroskaenc.c Wed Sep 05 00:25:38 2007 +0000 +++ b/matroskaenc.c Wed Sep 05 00:25:40 2007 +0000 @@ -748,7 +748,7 @@ if (ret < 0) return ret; } - mkv->duration = pkt->pts + pkt->duration; + mkv->duration = FFMAX(mkv->duration, pkt->pts + pkt->duration); return 0; }