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

shans at svn.annodex.net shans at svn.annodex.net
Wed Jul 18 22:11:15 PDT 2007


Author: shans
Date: 2007-07-18 22:11:15 -0700 (Wed, 18 Jul 2007)
New Revision: 3162

Modified:
   libannodex/trunk/src/importers/anx_import_ogg.c
Log:
Continue on even if end-time can't be determined (no eos packet?).  This 
avoids leaving initialisation with ogg stream seeked to end of file.



Modified: libannodex/trunk/src/importers/anx_import_ogg.c
===================================================================
--- libannodex/trunk/src/importers/anx_import_ogg.c	2007-07-12 23:50:29 UTC (rev 3161)
+++ libannodex/trunk/src/importers/anx_import_ogg.c	2007-07-19 05:11:15 UTC (rev 3162)
@@ -953,9 +953,11 @@
 #ifdef DEBUG
       fprintf (aod->df, "anxogg_setup: oggz_seek_units end FAIL\n");
 #endif
-      return -1;
+      //return -1;
+      end_time = -1;
+    } else {
+      end_time = ((double)units_at) / 1000.0;
     }
-    end_time = ((double)units_at) / 1000.0;
   } else {
     units = (ogg_int64_t)(SUBSECONDS * end_time);
     units_at = oggz_seek_units (aod->oggz, units, SEEK_SET);
@@ -979,7 +981,9 @@
   start_offset = oggz_tell (aod->oggz);
 
   aod->anx_source->byte_length = end_offset - start_offset;
-  aod->anx_source->duration = end_time - start_time;
+  if (end_time != -1) {
+    aod->anx_source->duration = end_time - start_time;
+  }
 
 #ifdef DEBUG
   fprintf (aod->df,



More information about the commits mailing list