[xiph-cvs] cvs commit: vorbis/lib block.c info.c
Monty
xiphmont at xiph.org
Mon Oct 30 16:10:38 PST 2000
xiphmont 00/10/30 16:10:38
Modified: include/vorbis Tag: branch_beta3 codec.h
lib Tag: branch_beta3 block.c info.c
Log:
Sample level editing stuff happily implemented/tested.
Monty
Revision Changes Path
No revision
No revision
1.32.2.2 +2 -2 vorbis/include/vorbis/codec.h
Index: codec.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/codec.h,v
retrieving revision 1.32.2.1
retrieving revision 1.32.2.2
diff -u -r1.32.2.1 -r1.32.2.2
--- codec.h 2000/10/14 03:14:06 1.32.2.1
+++ codec.h 2000/10/31 00:10:36 1.32.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: libvorbis codec headers
- last mod: $Id: codec.h,v 1.32.2.1 2000/10/14 03:14:06 xiphmont Exp $
+ last mod: $Id: codec.h,v 1.32.2.2 2000/10/31 00:10:36 xiphmont Exp $
********************************************************************/
@@ -218,7 +218,7 @@
int pcmend;
int mode;
- int eofflag;
+ int eofflag;
ogg_int64_t granulepos;
ogg_int64_t sequence;
vorbis_dsp_state *vd; /* For read-only access of configuration */
No revision
No revision
1.39.2.2 +21 -6 vorbis/lib/block.c
Index: block.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/block.c,v
retrieving revision 1.39.2.1
retrieving revision 1.39.2.2
diff -u -r1.39.2.1 -r1.39.2.2
--- block.c 2000/10/14 03:14:06 1.39.2.1
+++ block.c 2000/10/31 00:10:37 1.39.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.39.2.1 2000/10/14 03:14:06 xiphmont Exp $
+ last mod: $Id: block.c,v 1.39.2.2 2000/10/31 00:10:37 xiphmont Exp $
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
@@ -682,15 +682,30 @@
it reads the last two marked pages in proper sequence */
if(v->granulepos==-1)
- v->granulepos=vb->granulepos;
+ if(vb->granulepos==-1){
+ v->granulepos=0;
+ }else{
+ v->granulepos=vb->granulepos;
+ }
else{
v->granulepos+=(centerW-v->centerW);
if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
- if(v->granulepos>vb->granulepos && vb->eofflag){
- /* partial last frame. Strip the padding off */
- centerW-=(v->granulepos-vb->granulepos);
+
+ if(v->granulepos>vb->granulepos){
+ long extra=v->granulepos-vb->granulepos;
+
+ if(vb->eofflag){
+ /* partial last frame. Strip the extra samples off */
+ centerW-=extra;
+ }else if(vb->sequence == 1){
+ /* partial first frame. Discard extra leading samples */
+ v->pcm_returned+=extra;
+ if(v->pcm_returned>centerW)v->pcm_returned=centerW;
+
+ }
+
}/* else{ Shouldn't happen *unless* the bitstream is out of
- spec. Either way, believe the bitstream } */
+ spec. Either way, believe the bitstream } */
v->granulepos=vb->granulepos;
}
}
1.31.2.2 +2 -2 vorbis/lib/info.c
Index: info.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/info.c,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -u -r1.31.2.1 -r1.31.2.2
--- info.c 2000/10/14 03:14:06 1.31.2.1
+++ info.c 2000/10/31 00:10:37 1.31.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: maintain the info structure, info <-> header packets
- last mod: $Id: info.c,v 1.31.2.1 2000/10/14 03:14:06 xiphmont Exp $
+ last mod: $Id: info.c,v 1.31.2.2 2000/10/31 00:10:37 xiphmont Exp $
********************************************************************/
@@ -406,7 +406,7 @@
}
static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
- char temp[]="Xiphophorus libVorbis I 20000508";
+ char temp[]="Xiphophorus libVorbis I 20001031";
/* preamble */
oggpack_write(opb,0x03,8);
--- >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