[xiph-commits] r3494 - liboggz/trunk/src/tools

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Feb 25 22:16:24 PST 2008


Author: conrad
Date: 2008-02-25 22:16:24 -0800 (Mon, 25 Feb 2008)
New Revision: 3494

Modified:
   liboggz/trunk/src/tools/oggz-validate.c
Log:
use oggz_stream_get_content() API rather than local ot_page_identify() in
oggz-validate, and check Theora vs. audio bos ordering for more audio types
(PCM, FLAC0, FLAC, CELT)


Modified: liboggz/trunk/src/tools/oggz-validate.c
===================================================================
--- liboggz/trunk/src/tools/oggz-validate.c	2008-02-26 05:33:45 UTC (rev 3493)
+++ liboggz/trunk/src/tools/oggz-validate.c	2008-02-26 06:16:24 UTC (rev 3494)
@@ -224,7 +224,7 @@
 {
   OVData * ovdata = (OVData *)user_data;
   ogg_int64_t gpos = ogg_page_granulepos((ogg_page *)og);
-  const char * content_type;
+  OggzStreamContent content_type;
   int ret = 0;
 
   if (ovdata->chain_ended) {
@@ -238,18 +238,26 @@
     oggz_table_insert (ovdata->missing_eos, serialno, (void *)0x1);
 
     /* Handle ordering of Theora vs. audio packets */
-    content_type = ot_page_identify (oggz, og, NULL);
+    content_type = oggz_stream_get_content (oggz, serialno);
 
-    if (content_type) {
-      if (!strcmp (content_type, "Theora")) {
+    switch (content_type) {
+      case OGGZ_CONTENT_THEORA:
 	ovdata->theora_count++;
 	if (ovdata->audio_count > 0) {
 	  log_error ();
 	  fprintf (stderr, "serialno %010ld: Theora video bos page after audio bos page\n", serialno);
 	}
-      } else if (!strcmp (content_type, "Vorbis") || !strcmp (content_type, "Speex")) {
+        break;
+      case OGGZ_CONTENT_VORBIS:
+      case OGGZ_CONTENT_SPEEX:
+      case OGGZ_CONTENT_PCM:
+      case OGGZ_CONTENT_FLAC0:
+      case OGGZ_CONTENT_FLAC:
+      case OGGZ_CONTENT_CELT:
 	ovdata->audio_count++;
-      }
+        break;
+      default:
+        break;
     }
   }
 



More information about the commits mailing list