[xiph-cvs] cvs commit: ogg/src buffer.c stream.c sync.c

Monty xiphmont at xiph.org
Thu Mar 27 01:10:14 PST 2003



xiphmont    03/03/27 04:10:14

  Modified:    src      Tag: libogg2-zerocopy buffer.c stream.c sync.c
  Log:
  libogg2 passes all current unit tests

Revision  Changes    Path
No                   revision

<p>No                   revision

<p>1.1.2.12  +3 -1      ogg/src/Attic/buffer.c

Index: buffer.c
===================================================================
RCS file: /usr/local/cvsroot/ogg/src/Attic/buffer.c,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -u -r1.1.2.11 -r1.1.2.12
--- buffer.c	27 Mar 2003 07:12:45 -0000	1.1.2.11
+++ buffer.c	27 Mar 2003 09:10:14 -0000	1.1.2.12
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: centralized fragment buffer management
-  last mod: $Id: buffer.c,v 1.1.2.11 2003/03/27 07:12:45 xiphmont Exp $
+  last mod: $Id: buffer.c,v 1.1.2.12 2003/03/27 09:10:14 xiphmont Exp $
 
  ********************************************************************/
 
@@ -434,6 +434,8 @@
 /* *head is appended to the front end (head) of *tail; both continue to
    be valid pointers, with *tail at the tail and *head at the head */
 ogg_reference *ogg_buffer_cat(ogg_reference *tail, ogg_reference *head){
+  if(!tail)return head;
+
   while(tail->next){
 #ifdef OGGBUFFER_DEBUG
     if(tail->used==0){

<p><p>1.1.2.8   +17 -9     ogg/src/Attic/stream.c

Index: stream.c
===================================================================
RCS file: /usr/local/cvsroot/ogg/src/Attic/stream.c,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- stream.c	27 Mar 2003 07:12:45 -0000	1.1.2.7
+++ stream.c	27 Mar 2003 09:10:14 -0000	1.1.2.8
@@ -12,7 +12,7 @@
 
  function: code raw packets into framed Ogg logical stream and
            decode Ogg logical streams back into raw packets
- last mod: $Id: stream.c,v 1.1.2.7 2003/03/27 07:12:45 xiphmont Exp $
+ last mod: $Id: stream.c,v 1.1.2.8 2003/03/27 09:10:14 xiphmont Exp $
 
  ********************************************************************/
 
@@ -291,6 +291,12 @@
           os->holeflag=1;  /* set for internal use */
         else
           os->holeflag=2;  /* set for external reporting */
+
+	os->body_tail=ogg_buffer_pretruncate(os->body_tail,
+					     os->body_fill);
+	if(os->body_tail==0)os->body_head=0;
+	os->body_fill=0;
+
       }
     
       if(ogg_page_continued(&og)){
@@ -372,8 +378,8 @@
 
   ogg_buffer_release(os->header_tail);
   ogg_buffer_release(os->body_tail);
-  os->header_head=0;
-  os->body_head=0;
+  os->header_tail=os->header_head=0;
+  os->body_tail=os->body_head=0;
 
   os->e_o_s=0;
   os->b_o_s=0;
@@ -1177,7 +1183,7 @@
       ogg_sync_pageout(oy,&temp);
       ogg_stream_pagein(os_de,&temp);
       ogg_sync_pageout(oy,&temp);
-      /* skip */
+      ogg_page_release(&temp);/* skip */
       ogg_sync_pageout(oy,&temp);
       ogg_stream_pagein(os_de,&temp);
 
@@ -1189,7 +1195,7 @@
       checkpacket(&test,100,1,-1);
       if(ogg_stream_packetout(os_de,&test)!=1)error();
       checkpacket(&test,4079,2,3000);
-      if(ogg_stream_packetout(os_de,&test)!=-1){
+      if(ogg_stream_packetout(os_de,&test)!=OGG_HOLE){
         fprintf(stderr,"Error: loss of page did not return error\n");
         exit(1);
       }
@@ -1225,7 +1231,7 @@
       ogg_sync_pageout(oy,&temp);
       ogg_stream_pagein(os_de,&temp);
       ogg_sync_pageout(oy,&temp);
-      /* skip */
+      ogg_page_release(&temp);/* skip */
       ogg_sync_pageout(oy,&temp);
       ogg_stream_pagein(os_de,&temp);
 
@@ -1239,7 +1245,7 @@
       checkpacket(&test,4079,2,3000);
       if(ogg_stream_packetout(os_de,&test)!=1)error();
       checkpacket(&test,2956,3,4000);
-      if(ogg_stream_packetout(os_de,&test)!=-1){
+      if(ogg_stream_packetout(os_de,&test)!=OGG_HOLE){
         fprintf(stderr,"Error: loss of page did not return error\n");
         exit(1);
       }
@@ -1264,7 +1270,7 @@
       if(ogg_sync_pageout(oy,&og_de)>0)error();
       
       /* Test fractional page inputs: incomplete header */
-      bufcpy2(ogg_sync_bufferin(oy,ogg_buffer_length(og[1].header)),og[1].header,33);
+      bufcpy2(ogg_sync_bufferin(oy,ogg_buffer_length(og[1].header)),og[1].header,23);
       ogg_sync_wrote(oy,5);
       if(ogg_sync_pageout(oy,&og_de)>0)error();
       
@@ -1358,6 +1364,8 @@
       bufcpy(ogg_sync_bufferin(oy,ogg_buffer_length(og[1].body)),og[1].body);
       ogg_sync_wrote(oy,ogg_buffer_length(og[1].body));
 
+      /* garbage */
+
       bufcpy(ogg_sync_bufferin(oy,ogg_buffer_length(og[2].header)),og[2].header);
       ogg_sync_wrote(oy,ogg_buffer_length(og[2].header));
 
@@ -1370,7 +1378,7 @@
       ogg_sync_wrote(oy,ogg_buffer_length(og[2].body)-5);
 
       bufcpy(ogg_sync_bufferin(oy,ogg_buffer_length(og[3].header)),og[3].header);
-      ogg_sync_wrote(oy,ogg_buffer_length(og[1].header));
+      ogg_sync_wrote(oy,ogg_buffer_length(og[3].header));
 
       bufcpy(ogg_sync_bufferin(oy,ogg_buffer_length(og[3].body)),og[3].body);
       ogg_sync_wrote(oy,ogg_buffer_length(og[3].body));

<p><p>1.1.2.9   +4 -2      ogg/src/Attic/sync.c

Index: sync.c
===================================================================
RCS file: /usr/local/cvsroot/ogg/src/Attic/sync.c,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- sync.c	27 Mar 2003 07:12:45 -0000	1.1.2.8
+++ sync.c	27 Mar 2003 09:10:14 -0000	1.1.2.9
@@ -12,7 +12,7 @@
 
  function: decode stream sync and memory management foundation code;
            takes in raw data, spits out packets
- last mod: $Id: sync.c,v 1.1.2.8 2003/03/27 07:12:45 xiphmont Exp $
+ last mod: $Id: sync.c,v 1.1.2.9 2003/03/27 09:10:14 xiphmont Exp $
 
  note: The CRC code is directly derived from public domain code by
  Ross Williams (ross at guest.adelaide.edu.au).  See docs/framing.html
@@ -428,7 +428,9 @@
 int ogg_sync_reset(ogg_sync_state *oy){
 
   ogg_buffer_release(oy->fifo_tail);
-  oy->fifo_tail=oy->fifo_head=0;
+  oy->fifo_tail=0;
+  oy->fifo_head=0;
+  oy->fifo_fill=0;
 
   oy->unsynced=0;
   oy->headerbytes=0;

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list