[xiph-commits] r2885 - in liboggz/trunk: include/oggz src/liboggz win32

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Jun 11 04:29:13 PDT 2007


Author: conrad
Date: 2007-06-11 04:29:12 -0700 (Mon, 11 Jun 2007)
New Revision: 2885

Modified:
   liboggz/trunk/include/oggz/oggz.h
   liboggz/trunk/src/liboggz/Version_script.in
   liboggz/trunk/src/liboggz/oggz.c
   liboggz/trunk/win32/liboggz.def
Log:
Add new API call oggz_get_numtracks() to retrieve the number of logical
bitstreams.


Modified: liboggz/trunk/include/oggz/oggz.h
===================================================================
--- liboggz/trunk/include/oggz/oggz.h	2007-06-11 10:39:08 UTC (rev 2884)
+++ liboggz/trunk/include/oggz/oggz.h	2007-06-11 11:29:12 UTC (rev 2885)
@@ -543,6 +543,18 @@
 int oggz_get_eos (OGGZ * oggz, long serialno);
 
 /**
+ * Query the number of tracks (logical bitstreams). When reading, this
+ * number is incremented every time a new track is found, so the returned
+ * value is only correct once the OGGZ is no longer at bos (beginning of
+ * stream): see oggz_get_bos() for determining this.
+ * \param oggz An OGGZ handle
+ * \return The number of tracks in OGGZ
+ * \retval OGGZ_ERR_BAD_SERIALNO \a serialno does not identify an existing
+ * logical bitstream in \a oggz.
+ */
+int oggz_get_numtracks (OGGZ * oggz);
+
+/**
  * Request a new serialno, as required for a new stream, ensuring the serialno
  * is not yet used for any other streams managed by this OGGZ.
  * \param oggz An OGGZ handle

Modified: liboggz/trunk/src/liboggz/Version_script.in
===================================================================
--- liboggz/trunk/src/liboggz/Version_script.in	2007-06-11 10:39:08 UTC (rev 2884)
+++ liboggz/trunk/src/liboggz/Version_script.in	2007-06-11 11:29:12 UTC (rev 2885)
@@ -15,6 +15,7 @@
 		oggz_close;
 		oggz_get_bos;
 		oggz_get_eos;
+		oggz_get_numtracks;
 
 		oggz_run_set_blocksize;
 		oggz_run;

Modified: liboggz/trunk/src/liboggz/oggz.c
===================================================================
--- liboggz/trunk/src/liboggz/oggz.c	2007-06-11 10:39:08 UTC (rev 2884)
+++ liboggz/trunk/src/liboggz/oggz.c	2007-06-11 11:29:12 UTC (rev 2885)
@@ -432,6 +432,13 @@
   return 0;
 }
 
+int
+oggz_get_numtracks (OGGZ * oggz)
+{
+  if (oggz == NULL) return OGGZ_ERR_BAD_OGGZ;
+  return oggz_vector_size (oggz->streams);
+}
+
 long
 oggz_serialno_new (OGGZ * oggz)
 {

Modified: liboggz/trunk/win32/liboggz.def
===================================================================
--- liboggz/trunk/win32/liboggz.def	2007-06-11 10:39:08 UTC (rev 2884)
+++ liboggz/trunk/win32/liboggz.def	2007-06-11 11:29:12 UTC (rev 2885)
@@ -82,6 +82,11 @@
 oggz_table_nth				@48
 
 ;
+; General querying
+;
+oggz_get_numtracks			@49
+
+;
 ;oggz stream functions (determining content type)
 ;
 oggz_stream_get_content                 @100



More information about the commits mailing list