[xiph-commits] r3740 - libannodex/trunk/src/importers

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Oct 27 01:04:46 PDT 2008


Author: conrad
Date: 2008-10-27 01:04:46 -0700 (Mon, 27 Oct 2008)
New Revision: 3740

Modified:
   libannodex/trunk/src/importers/anx_import_ogg.c
Log:
Very rough estiate of Vorbis start granule, 1s before requested start time


Modified: libannodex/trunk/src/importers/anx_import_ogg.c
===================================================================
--- libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-27 08:04:40 UTC (rev 3739)
+++ libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-27 08:04:46 UTC (rev 3740)
@@ -356,7 +356,11 @@
         track->granule_rate_n = (anx_int64_t) INT32_LE_AT(&header[12]);
         track->granule_rate_d = 1;
         track->nr_header_packets = 3;
-        track->basegranule = 0;
+        if (m->start_time < 1.0) {
+          track->basegranule = 0;
+        } else {
+          track->basegranule = (m->start_time - 1.0) * track->granule_rate_n;
+        }
         track->preroll = 2;
         track->granuleshift = 0;
       } else if (!strncmp ((char *)&op->packet[0], "Speex   ", 8)) {



More information about the commits mailing list