[xiph-commits] r7244 - branches/ogg2-arc/src
arc at dactyl.lonelymoon.com
arc
Wed Jul 21 13:01:09 PDT 2004
Author: arc
Date: Wed Jul 21 13:01:09 2004
New Revision: 7244
Modified:
branches/ogg2-arc/src/stream.c
Log:
I believe that the previous commit (7243) was using the granulepos of a
packet continued from a previous page, and I believe we want to use the
granulepos of the first packet which starts on a page instead.
I believe that this commit uses the granulepos of the first packet to
start on a page. I have done my best to check that this is what it
does, but am unsure.
Modified: branches/ogg2-arc/src/stream.c
===================================================================
--- branches/ogg2-arc/src/stream.c 2004-07-21 19:40:29 UTC (rev 7243)
+++ branches/ogg2-arc/src/stream.c 2004-07-21 20:01:08 UTC (rev 7244)
@@ -38,7 +38,6 @@
os->mode=mode;
return OGG_SUCCESS;
}
- else printf("Error, pageno==%d, packets==%d\n", os->pageno, os->packets);
}
return OGG_EMODE;
}
@@ -143,6 +142,10 @@
if(!os->lacing_fill)
oggbyte_init(&os->header_build,0,os->bufferpool);
+ /* for discontinuous mode */
+ if(os->mode&&!os->packets)os->granulepos=op->granulepos;
+ os->packets++;
+
/* concat packet data */
if(os->body_head)
os->body_head=ogg_buffer_cat(os->body_head,op->packet);
@@ -163,9 +166,8 @@
granulepos et al and then finish packet lacing */
os->body_fill+=remainder;
- if(!os->mode||!os->packets)os->granulepos=op->granulepos;
+ if(!os->mode)os->granulepos=op->granulepos;
os->packetno++; /* for the sake of completeness */
- os->packets++; /* packets in current page, used for discontinuous */
if(op->e_o_s)os->e_o_s=1;
oggbyte_set1(&os->header_build,remainder,27+os->lacing_fill++);
More information about the commits
mailing list