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

conrad at svn.annodex.net conrad at svn.annodex.net
Wed Oct 29 04:06:21 PDT 2008


Author: conrad
Date: 2008-10-29 04:06:21 -0700 (Wed, 29 Oct 2008)
New Revision: 3750

Modified:
   libannodex/trunk/src/importers/anx_import_ogg.c
Log:
anx_import_ogg: cleanups and commentary


Modified: libannodex/trunk/src/importers/anx_import_ogg.c
===================================================================
--- libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-29 11:06:15 UTC (rev 3749)
+++ libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-29 11:06:21 UTC (rev 3750)
@@ -302,7 +302,11 @@
  * Setup
  */
 
-/* Parse Ogg BOS packet headers and fill in track info. */
+/*
+ * OggzReadPacket read_packet_headers
+ *
+ * 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)
@@ -491,7 +495,9 @@
 }
 
 /*
- * look for tracks, extract granule information.  This is a preprocessor
+ * OggzReadPage read_page_granuleinfo
+ *
+ * Look for tracks, extract granule information.  This is a preprocessor
  * step that scans until info is found for all tracks.  When all tracks
  * are found, granuleinfo_update_state will set the state to FILTER and the
  * loop will end.
@@ -612,7 +618,6 @@
   return OGGZ_STOP_OK;
 }
 
-
 static int
 anxogg_setup (AnxOggData * aod)
 {
@@ -885,6 +890,11 @@
 #endif
 }
 
+/*
+ * OggzReadPacket read_packet_data
+ *
+ * Packet reading callback for normal packet delivery after start time.
+ */
 static int
 read_packet_data (OGGZ * oggz, ogg_packet * op, long serialno,
 		  void * user_data)
@@ -932,22 +942,16 @@
       {
         char * header = (char *)op->packet;
         fprintf (aod->df,
-                  "anxogg::read_packet_data: got CMML <%c%c%c%c> at %f\n",
-                  header[1], header[2], header[3], header[4], at_time);
+                 "anxogg::read_packet_data: got CMML <%c%c%c%c> at %f\n",
+                 header[1], header[2], header[3], header[4], at_time);
       }
 #endif
 
       /* If this content doesn't use cmml_granuleshift, and this clip is
        * before the start_time, drop it */
-      if 
-      (
-        aod->cmml_granuleshift == 0 && op->bytes > 6 
-        &&
-        !strncmp ((char *)op->packet, "<clip", 5) 
-        &&
-	      at_time < aod->anx_source->start_time-TOLERANCE
-      ) 
-      {
+      if (aod->cmml_granuleshift == 0 && op->bytes > 6 &&
+          !strncmp ((char *)op->packet, "<clip", 5) &&
+	  at_time < aod->anx_source->start_time-TOLERANCE) {
 #ifdef DEBUG
 	      fprintf (aod->df,
 		            "anxogg::read_packet_data: CMML clip too early, dropping\n");
@@ -957,7 +961,7 @@
 
       if (aod->import_cmml) {
       	aod->import_cmml ((char *)op->packet, op->bytes, at_time,
-			                      aod->import_user_data);
+                          aod->import_user_data);
       }
       return OGGZ_CONTINUE;
     } else {
@@ -987,7 +991,7 @@
 
 #ifdef DEBUG
   fprintf (aod->df, "anxogg::read_packet: Filter? (%s)\n", 
-        aod->state == STATE_FILTER ? "USE_FN" : "NO_FN");
+           aod->state == STATE_FILTER ? "USE_FN" : "NO_FN");
 #endif
 
   if (!aod->ignore_media && !aod->got_end &&
@@ -1008,20 +1012,13 @@
 
 #ifdef DEBUG
       fprintf (aod->df,
-	       "anxogg::read_packet_data: nr_headers_remaining = %d, start_time = %f\n",
-	      aod->nr_headers_remaining, m->start_time);
+               "anxogg::read_packet_data: nr_headers_remaining = %d, start_time = %f\n",
+               aod->nr_headers_remaining, m->start_time);
 #endif
     }
 
-    if 
-    (
-      aod->need_seek == NEED_SEEK_PENDING 
-      &&
-	    aod->nr_headers_remaining == 0 
-      &&
-	    m->start_time != 0.0
-    ) 
-    {
+    if (aod->need_seek == NEED_SEEK_PENDING &&
+        aod->nr_headers_remaining == 0 && m->start_time != 0.0) {
       if (oggz_seek_units (oggz, 0, SEEK_CUR) >= 0) {
 #ifdef DEBUG
       	fprintf (aod->df, "anxogg::read_packet_data NEED seek\n");



More information about the commits mailing list