diff oggdec.c @ 5276:5de92e352cf9 libavformat

Calculate correct packet durations when demuxing Ogg/Speex. This involves determining if there is any delay in the first packet and/or any truncation in the final packet.
author jbr
date Mon, 12 Oct 2009 21:30:03 +0000
parents 432736854b4c
children 68c8e7affd44
line wrap: on
line diff
--- a/oggdec.c	Mon Oct 12 16:38:08 2009 +0000
+++ b/oggdec.c	Mon Oct 12 21:30:03 2009 +0000
@@ -380,6 +380,7 @@
 
     if (os->header > -1 && os->seq > os->header){
         os->pflags = 0;
+        os->pduration = 0;
         if (os->codec && os->codec->packet)
             os->codec->packet (s, idx);
         if (str)
@@ -524,6 +525,7 @@
     }
 
     pkt->flags = os->pflags;
+    pkt->duration = os->pduration;
 
     return psize;
 }