changeset 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 e993cab1faf3
files oggdec.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
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;