[xiph-commits] r9024 - in branches/ogg2-arc: . include/ogg2 src

arc at motherfish-iii.xiph.org arc at motherfish-iii.xiph.org
Thu Mar 3 04:56:23 PST 2005


Author: arc
Date: 2005-03-03 04:56:20 -0800 (Thu, 03 Mar 2005)
New Revision: 9024

Modified:
   branches/ogg2-arc/configure.in
   branches/ogg2-arc/include/ogg2/ogg.h
   branches/ogg2-arc/src/ogginternal.h
   branches/ogg2-arc/src/stream.c
   branches/ogg2-arc/src/sync.c
Log:
This compiles, and should work again, tho the whole top/end granule
functionality isn't there.  Currently, just use end_granule just as
granulepos was in the past and things should be fine.



Modified: branches/ogg2-arc/configure.in
===================================================================
--- branches/ogg2-arc/configure.in	2005-03-03 11:49:05 UTC (rev 9023)
+++ branches/ogg2-arc/configure.in	2005-03-03 12:56:20 UTC (rev 9024)
@@ -295,6 +295,8 @@
 doc/Makefile
 doc/ogg2/Makefile
 include/Makefile
+include/ogg/Makefile
+include/ogg/config_types.h
 include/ogg2/Makefile
 include/ogg2/config_types.h
 win32/Makefile

Modified: branches/ogg2-arc/include/ogg2/ogg.h
===================================================================
--- branches/ogg2-arc/include/ogg2/ogg.h	2005-03-03 11:49:05 UTC (rev 9023)
+++ branches/ogg2-arc/include/ogg2/ogg.h	2005-03-03 12:56:20 UTC (rev 9024)
@@ -42,7 +42,7 @@
   long           bytes;
   long           b_o_s;
   long           e_o_s;
-  ogg_int64_t    start_granule;
+  ogg_int64_t    top_granule;
   ogg_int64_t    end_granule;
   ogg_int64_t    packetno;     /* sequence number for decode; the framing
 				  knows where there's a hole in the data,
@@ -155,7 +155,6 @@
 #define  OGG2_ESERIAL  -13
 #define  OGG2_EINVAL   -14
 #define  OGG2_EEOS     -15
-#define  OGG2_EMODE    -16
 
 #ifdef __cplusplus
 }

Modified: branches/ogg2-arc/src/ogginternal.h
===================================================================
--- branches/ogg2-arc/src/ogginternal.h	2005-03-03 11:49:05 UTC (rev 9023)
+++ branches/ogg2-arc/src/ogginternal.h	2005-03-03 12:56:20 UTC (rev 9024)
@@ -115,7 +115,7 @@
 			      (which is in a seperate abstraction
 			      layer) also knows about the gap */
   ogg_int64_t    granulepos;
-  int            mode;     /* 0 = continuous, 1 = discontinuous */
+  int            discont;  /* 0 = continuous, 1 = discontinuous */
 
   int            lacing_fill;
   ogg_uint32_t   body_fill;

Modified: branches/ogg2-arc/src/stream.c
===================================================================
--- branches/ogg2-arc/src/stream.c	2005-03-03 11:49:05 UTC (rev 9023)
+++ branches/ogg2-arc/src/stream.c	2005-03-03 12:56:20 UTC (rev 9024)
@@ -31,18 +31,13 @@
   return os;
 } 
 
-int ogg2_stream_setmode(ogg2_stream_state *os, int mode){
-  /* I don't know what extra modes may be needed, but we might as well
-     provide support for them in the API. */
-
-  /* (Dis)cont mode must be known and set before Page 1 is processed */
-  if(mode&1){
-    if(os->pageno==0||(os->pageno==1&&os->packets==0)){
-      os->mode=mode;
-      return OGG2_SUCCESS;
-    }
+int ogg2_stream_setdiscont(ogg2_stream_state *os){
+  /* Discont mode must be known and set before Page 1 is processed */
+  if(os->pageno==0||(os->pageno==1&&os->packets==0)){
+    os->discont=1;
+    return OGG2_SUCCESS;
   }
-  return OGG2_EMODE;
+  return OGG2_EINVAL;
 }
 
 int ogg2_stream_setfill(ogg2_stream_state *os,int watermark){
@@ -143,10 +138,10 @@
   }
 
   if(!os->lacing_fill)
-    ogg2byte_init(&os->header_build,0,os->bufferpool);
+    ogg2byte_init(&os->header_build, 0, os->bufferpool);
 
   /* for discontinuous mode */
-  if(os->mode&1&&!os->packets)os->granulepos=op->granulepos;
+  if(os->discont && !os->packets) os->granulepos=op->end_granule;
   os->packets++;   
 
   /* concat packet data */
@@ -169,7 +164,7 @@
      granulepos et al and then finish packet lacing */
   
   os->body_fill+=remainder;
-  if(!(os->mode&1))os->granulepos=op->granulepos;
+  if (!os->discont) os->granulepos=op->end_granule;
   os->packetno++;  /* for the sake of completeness */
   if(op->e_o_s)os->e_o_s=1;
   ogg2byte_set1(&os->header_build,remainder,27+os->lacing_fill++);
@@ -491,21 +486,21 @@
     else
       op->e_o_s=0;
 
-    if(os->mode&1){
+    if (os->discont){
       /* Discontinuous Mode */
       if(!os->continued) {
-        if(os->packets==0)op->granulepos=os->granulepos;
-        else op->granulepos=-1;
+        if(os->packets==0)op->end_granule=os->granulepos;
+        else op->end_granule=-1;
       }else{
-        if(os->packets==1)op->granulepos=os->granulepos;
-        else op->granulepos=-1;
+        if(os->packets==1)op->end_granule=os->granulepos;
+        else op->end_granule=-1;
       }
     }else{
       /* Continuous Mode */
       if( (os->body_fill&FINFLAG) && !(os->body_fill_next&FINFLAG) )
-        op->granulepos=os->granulepos;
+        op->end_granule=os->granulepos;
       else
-        op->granulepos=-1;
+        op->end_granule=-1;
     }
     
     os->packets++;
@@ -585,7 +580,7 @@
     fprintf(stderr,"incorrect packet length!\n");
     exit(1);
   }
-  if(op->granulepos!=pos){
+  if(op->end_granule!=pos){
     fprintf(stderr,"incorrect packet position!\n");
     exit(1);
   }

Modified: branches/ogg2-arc/src/sync.c
===================================================================
--- branches/ogg2-arc/src/sync.c	2005-03-03 11:49:05 UTC (rev 9023)
+++ branches/ogg2-arc/src/sync.c	2005-03-03 12:56:20 UTC (rev 9024)
@@ -591,7 +591,8 @@
   dup->bytes=orig->bytes;
   dup->b_o_s=orig->b_o_s;
   dup->e_o_s=orig->e_o_s;
-  dup->granulepos=orig->granulepos;
+  dup->top_granule=orig->top_granule;
+  dup->end_granule=orig->end_granule;
   dup->packetno=orig->packetno;
 
   dup->packet=ogg2_buffer_dup(orig->packet);



More information about the commits mailing list