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

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Oct 27 01:44:59 PDT 2008


Author: conrad
Date: 2008-10-27 01:44:58 -0700 (Mon, 27 Oct 2008)
New Revision: 3741

Modified:
   libannodex/trunk/src/importers/anx_import_ogg.c
Log:
anx_ogg_importer: add some comments


Modified: libannodex/trunk/src/importers/anx_import_ogg.c
===================================================================
--- libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-27 08:04:46 UTC (rev 3740)
+++ libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-27 08:44:58 UTC (rev 3741)
@@ -54,6 +54,11 @@
 #include <annodex/anx_import.h>
 #include <annodex/annodex.h>
 
+/***********************************************************
+ * Preprocessor macros and constants.
+ */
+
+/* Byte access macros */
 #define INT8_AT(x) (*(unsigned char *)(x))
 #define INT32_LE_AT(x) _le_32((*(ogg_int32_t *)(x)))
 #define INT32_BE_AT(x) _be_32((*(ogg_int32_t *)(x)))
@@ -77,6 +82,10 @@
 
 #define SUBSECONDS 1000.0
 
+/***********************************************************
+ * Types.
+ */
+
 typedef enum {
   STATE_HEADERS,
   STATE_GRANULEINFO,
@@ -154,8 +163,25 @@
   int cmml_need_keygranule;
 };
 
+
+/***********************************************************
+ * A statically defined AnxImporter.
+ * 
+ * WTF: This is referenced in anxogg_open(), but nowhere else,
+ * and does not correspond to the actual importers used for
+ * each media type.
+ */
 static AnxImporter anxogg_importer;
 
+
+/***********************************************************
+ * Byte-swapping functions.
+ * NB. These are defined here statically so that they will
+ * not be exposed in the resulting shared object file.
+ * A separate C file and a GCC version script would be
+ * cleaner, but less portable.
+ */
+
 static ogg_uint32_t
 _le_32 (ogg_uint32_t i)
 {
@@ -210,6 +236,10 @@
   return (*(ogg_int64_t *)ucptr);
 }
 
+/***********************************************************
+ * Utility functions.
+ */
+
 static ogg_int64_t
 gp_to_granule (OGGZ * oggz, long serialno, ogg_int64_t granulepos)
 {
@@ -247,6 +277,9 @@
   return strcpy (ret, s);
 }
 
+/***********************************************************
+ * 
+ */
 static double
 anxogg_seek_update (AnxSource * source)
 {
@@ -259,13 +292,12 @@
     seek_offset = aod->min_granule_seek;
 #ifdef DEBUG
     fprintf(aod->df, "anxogg_seek_update: using min_granule_seek %f\n", 
-                seek_offset);
+            seek_offset);
 #endif
   } else {
     seek_offset = source->start_time;
 #ifdef DEBUG
-    fprintf(aod->df, "anxogg_seek_update: using start time %f\n", 
-                seek_offset);
+    fprintf(aod->df, "anxogg_seek_update: using start time %f\n", seek_offset);
 #endif
   }
   seek_offset -= 1.0;
@@ -302,6 +334,9 @@
   return offset;
 }
 
+/***********************************************************
+ * Parse Ogg BOS packet headers and fill in track info.
+ */
 static int
 read_packet_headers (OGGZ * oggz, ogg_packet * op, long serialno,
 		     void * user_data)
@@ -551,6 +586,14 @@
   return OGGZ_CONTINUE;
 }
 
+/***********************************************************
+ * A filter predicate, used between the min seek granule
+ * and the start time (ie. the bit between the prior keyframe
+ * and the chop time) to filter packets which should be
+ * included in the output.
+ * \returns 0 Do not include \a op
+ * \returns 1 Do include \a op
+ */
 static int
 filter (AnxOggData * aod, AnxOggTrack * aot, long serialno, ogg_packet * op) {
 



More information about the commits mailing list