summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README61
-rw-r--r--include/ogg/ogg.h1
-rw-r--r--src/framing.c33
3 files changed, 93 insertions, 2 deletions
diff --git a/README b/README
index e3aad42..18dea68 100644
--- a/README
+++ b/README
@@ -1 +1,60 @@
-This is the Ogg bistream library
+********************************************************************
+* *
+* THIS FILE IS PART OF THE Ogg BITSTREAM LAYER SOURCE CODE. *
+* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
+* PLEASE READ THESE TERMS DISTRIBUTING. *
+* *
+* THE Ogg SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
+* by Monty <monty@xiph.org> and The XIPHOPHORUS Company *
+* http://www.xiph.org/ *
+* *
+********************************************************************
+
+WHAT'S HERE:
+
+This source distribution includes libogg and nothing else. Other modules (eg, the modules vorbis, vorbis-tools and vorbis-plugins for the Vorbis codec) contain the codec libraries for use with Ogg bitstreams.
+
+Directory:
+
+./lib The source for libogg, an LGPLed inplementation of
+ the public domain Ogg bitstream format
+
+./include Library API headers and codebooks
+
+./debian Rules/spec files for building Debian .deb packages
+
+./doc Ogg specification documents
+
+WHAT IS OGG?:
+
+Ogg project codecs use the Ogg bitstream format to arrange the raw,
+compressed bitstream into a more robust, useful form. For example,
+the Ogg bitstream makes seeking, time stamping and error recovery
+possible, as well as mixing several sepearate, concurrent media
+streams into a single physical bitstream.
+
+CONTACT:
+
+The Ogg homepage is located at 'http://www.xiph.org/ogg/'.
+Up to date technical documents, contact information, source code and
+pre-built utilities may be found there.
+
+BUILD:
+
+A standard build should consist of nothing more than:
+
+./autogen.sh
+make
+
+and as root if desired :
+
+make install
+
+This will install the Ogg libraries (static and shared) into
+/usr/local/lib, includes into /usr/local/include and API manpages
+(once we write some) into /usr/local/man.
+
+Monty <monty@xiph.org>
+
+$Id: README,v 1.4 2000/10/10 05:42:33 xiphmont Exp $
diff --git a/include/ogg/ogg.h b/include/ogg/ogg.h
index bfc6a5f..b35b4c8 100644
--- a/include/ogg/ogg.h
+++ b/include/ogg/ogg.h
@@ -145,6 +145,7 @@ extern int ogg_page_eos(ogg_page *og);
extern ogg_int64_t ogg_page_granulepos(ogg_page *og);
extern int ogg_page_serialno(ogg_page *og);
extern int ogg_page_pageno(ogg_page *og);
+ extern int ogg_page_packets(ogg_page *og);
#ifdef __cplusplus
diff --git a/src/framing.c b/src/framing.c
index c0dc7e4..b7a6193 100644
--- a/src/framing.c
+++ b/src/framing.c
@@ -13,7 +13,7 @@
function: code raw [Vorbis] packets into framed OggSquish stream and
decode Ogg streams back into raw packets
- last mod: $Id: framing.c,v 1.4 2000/09/28 05:01:56 jack Exp $
+ last mod: $Id: framing.c,v 1.5 2000/10/10 05:42:34 xiphmont Exp $
note: The CRC code is directly derived from public domain code by
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html
@@ -35,6 +35,10 @@ int ogg_page_continued(ogg_page *og){
return((int)(og->header[5]&0x01));
}
+int ogg_page_continued(ogg_page *og){
+ return((int)(og->header[5]&0x01));
+}
+
int ogg_page_bos(ogg_page *og){
return((int)(og->header[5]&0x02));
}
@@ -70,6 +74,33 @@ int ogg_page_pageno(ogg_page *og){
(og->header[21]<<24));
}
+
+
+/* returns the number of packets that are completed on this page (if
+ the leading packet is begun on a previous page, but ends on this
+ page, it's counted */
+
+/* NOTE:
+If a page consists of a packet begun on a previous page, and a new
+packet begun (but not completed) on this page, the return will be:
+ ogg_page_packets(page) ==1,
+ ogg_page_continued(page) !=0
+
+If a page happens to be a single packet that was begun on a
+previous page, and spans to the next page (in the case of a three or
+more page packet), the return will be:
+ ogg_page_packets(page) ==0,
+ ogg_page_continued(page) !=0
+*/
+
+int ogg_page_packets(ogg_page *og){
+ int i,n=og->header[26],count=0;
+ for(i=0;i<n;i++)
+ if(og->header[27+i]==0)count++;
+ return(count);
+}
+
+
/* helper to initialize lookup for direct-table CRC */
static ogg_uint32_t crc_lookup[256];