[xiph-cvs] cvs commit: vorbis/lib block.c codec_internal.h

Monty xiphmont at xiph.org
Mon Mar 26 15:27:43 PST 2001



xiphmont    01/03/26 15:27:43

  Modified:    doc      v-comment.html
               examples decoder_example.c
               lib      block.c codec_internal.h
  Log:
  Fix the initial frame bug triggered by vcut; if the first block of a
  stream was long, libvorbis would accidentally output audio for the
  very forst audio packet.  Second packet was handled correctly.
  
  Monty

Revision  Changes    Path
1.5       +2 -2      vorbis/doc/v-comment.html

Index: v-comment.html
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/v-comment.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- v-comment.html	2001/02/10 01:23:37	1.4
+++ v-comment.html	2001/03/26 23:27:42	1.5
@@ -7,7 +7,7 @@
 Ogg Vorbis comment field specification
 </font></h1>
 
-Last update to this document: January 19, 2001</em><p>
+Last update to this document: February 9, 2001</em><p>
 
 The text comment header is the second (of three) header packets that
 begin a Vorbis bitstream. It is meant for short, text comments,
@@ -188,7 +188,7 @@
 
 OggSquish, Vorbis, Xiphophorus and their logos are trademarks (tm) of
 <a href="http://www.xiph.org/">Xiphophorus</a>.  These pages are
-copyright (C) 1994-2000 Xiphophorus. All rights reserved.<p>
+copyright (C) 1994-2001 Xiphophorus. All rights reserved.<p>
 
 </body>
 

1.19      +2 -2      vorbis/examples/decoder_example.c

Index: decoder_example.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/examples/decoder_example.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- decoder_example.c	2001/02/26 03:50:38	1.18
+++ decoder_example.c	2001/03/26 23:27:42	1.19
@@ -7,11 +7,11 @@
  *                                                                  *
  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
-
+ *                                                                  *
  ********************************************************************
 
  function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.18 2001/02/26 03:50:38 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.19 2001/03/26 23:27:42 xiphmont Exp $
 
  ********************************************************************/
 

1.47      +11 -4     vorbis/lib/block.c

Index: block.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/block.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- block.c	2001/02/26 03:50:41	1.46
+++ block.c	2001/03/26 23:27:42	1.47
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.46 2001/02/26 03:50:41 xiphmont Exp $
+ last mod: $Id: block.c,v 1.47 2001/03/26 23:27:42 xiphmont Exp $
 
  Handle windowing, overlap-add, etc of the PCM vectors.  This is made
  more amusing by Vorbis' current two allowed block sizes.
@@ -617,9 +617,7 @@
   codec_setup_info *ci=vi->codec_setup;
   _vds_shared_init(v,vi,0);
 
-  /* Adjust centerW to allow an easier mechanism for determining output */
-  v->pcm_returned=v->centerW;
-  v->centerW-= ci->blocksizes[v->W]/4+ci->blocksizes[v->lW]/4;
+  v->pcm_returned=-1;
   v->granulepos=-1;
   v->sequence=-1;
 
@@ -725,7 +723,13 @@
     
     }
 
+    /* deal with initial packet state; we do this using the explicit
+       pcm_returned==-1 flag otherwise we're sensitive to first block
+       being short or long */
 
+    if(v->pcm_returned==-1)
+      v->pcm_returned=centerW;
+
     /* track the frame number... This is for convenience, but also
        making sure our last packet doesn't end with added padding.  If
        the last packet is partial, the number of samples we'll have to
@@ -754,6 +758,9 @@
             /* partial last frame.  Strip the extra samples off */
             centerW-=extra;
           }else if(vb->sequence == 1){
+	    /* ^^^ argh, this can be 1 from seeking! */
+
+
             /* partial first frame.  Discard extra leading samples */
             v->pcm_returned+=extra;
             if(v->pcm_returned>centerW)v->pcm_returned=centerW;

1.8       +1 -2      vorbis/lib/codec_internal.h

Index: codec_internal.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/codec_internal.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- codec_internal.h	2001/02/26 03:50:41	1.7
+++ codec_internal.h	2001/03/26 23:27:43	1.8
@@ -7,11 +7,10 @@
  *                                                                  *
  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
-
  ********************************************************************
 
  function: libvorbis codec headers
- last mod: $Id: codec_internal.h,v 1.7 2001/02/26 03:50:41 xiphmont Exp $
+ last mod: $Id: codec_internal.h,v 1.8 2001/03/26 23:27:43 xiphmont Exp $
 
  ********************************************************************/
 

--- >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