summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2000-04-06 15:39:43 +0000
committerMonty <xiphmont@xiph.org>2000-04-06 15:39:43 +0000
commitdd7b01876b6d06a51b2a5b04c7522ce9e2b00de4 (patch)
treea4f8da9332a601ee385066357026a6a8734096fa /lib
parent53c9bd97a70ba35ad99954d7ea0422de8f44ac19 (diff)
downloadlibvorbis-git-dd7b01876b6d06a51b2a5b04c7522ce9e2b00de4.tar.gz
Fixed the selftest to catch up with minor API change earlier this
week... and then the selftest caught a bug introduced in said change :-) Monty svn path=/trunk/vorbis/; revision=305
Diffstat (limited to 'lib')
-rw-r--r--lib/framing.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/framing.c b/lib/framing.c
index f79c63fc..b0de497e 100644
--- a/lib/framing.c
+++ b/lib/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.16 2000/04/03 09:45:55 xiphmont Exp $
+ last mod: $Id: framing.c,v 1.17 2000/04/06 15:39:43 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
@@ -303,6 +303,11 @@ int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og){
/* 32 bits of page counter (we have both counter and page header
because this val can roll over) */
+ if(os->pageno==-1)os->pageno=0; /* because someone called
+ stream_reset; this would be a
+ strange thing to do in an
+ encode stream, but it has
+ plausible uses */
{
long pageno=os->pageno++;
for(i=18;i<22;i++){
@@ -875,8 +880,8 @@ void test_pack(int *pl, int **headers){
int eosflag=0;
int bosflag=0;
- ogg_stream_reset(&os_en,0);
- ogg_stream_reset(&os_de,0);
+ ogg_stream_reset(&os_en);
+ ogg_stream_reset(&os_de);
ogg_sync_reset(&oy);
for(packets=0;;packets++)if(pl[packets]==-1)break;
@@ -1303,7 +1308,7 @@ int main(void){
int inptr=0,i,j;
ogg_page og[5];
- ogg_stream_reset(&os_en,0);
+ ogg_stream_reset(&os_en);
for(i=0;pl[i]!=-1;i++){
ogg_packet op;
@@ -1337,7 +1342,7 @@ int main(void){
fprintf(stderr,"Testing loss of pages... ");
ogg_sync_reset(&oy);
- ogg_stream_reset(&os_de,0);
+ ogg_stream_reset(&os_de);
for(i=0;i<5;i++){
memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header,
og[i].header_len);
@@ -1382,7 +1387,7 @@ int main(void){
fprintf(stderr,"Testing loss of pages (rollback required)... ");
ogg_sync_reset(&oy);
- ogg_stream_reset(&os_de,0);
+ ogg_stream_reset(&os_de);
for(i=0;i<5;i++){
memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header,
og[i].header_len);