diff oggdec.c @ 5813:e6cd8ca154f5 libavformat

oggdec: Fix duration calculation for streams with non-zero start
author conrad
date Thu, 11 Mar 2010 07:17:43 +0000
parents c66b238d4d33
children c587ece53810
line wrap: on
line diff
--- a/oggdec.c	Thu Mar 11 07:17:40 2010 +0000
+++ b/oggdec.c	Thu Mar 11 07:17:43 2010 +0000
@@ -460,6 +460,8 @@
     if (idx != -1){
         s->streams[idx]->duration =
             ogg_gptopts (s, idx, ogg->streams[idx].granule, NULL);
+        if (s->streams[idx]->start_time != AV_NOPTS_VALUE)
+            s->streams[idx]->duration -= s->streams[idx]->start_time;
     }
 
     ogg->size = size;