changeset 2505:81b1f6c373b4 libavformat

Make sure that the calculated duration doesn't decrease
author conrad
date Wed, 05 Sep 2007 00:25:40 +0000
parents 39c0db7c20be
children 623cb1c85104
files matroskaenc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }