[xiph-commits] r11544 - branches/vorbis-tahseen/lib

tahseen at svn.xiph.org tahseen at svn.xiph.org
Thu Jun 8 03:49:19 PDT 2006


Author: tahseen
Date: 2006-06-08 03:49:12 -0700 (Thu, 08 Jun 2006)
New Revision: 11544

Modified:
   branches/vorbis-tahseen/lib/vorbisfile.c
Log:
Support for chained vorbis bitstream is back again.


Modified: branches/vorbis-tahseen/lib/vorbisfile.c
===================================================================
--- branches/vorbis-tahseen/lib/vorbisfile.c	2006-06-08 05:37:27 UTC (rev 11543)
+++ branches/vorbis-tahseen/lib/vorbisfile.c	2006-06-08 10:49:12 UTC (rev 11544)
@@ -595,10 +595,17 @@
       /* has our decoding just traversed a bitstream boundary? */
       if(vf->ready_state==INITSET){
 	if(vf->os.serialno!=ogg_page_serialno(&og)){
-	  /* found a packet we are not going to decode, its non-vorbis 
-	   * or not part of the first vorbis stream. so try getting the next page.
-	   */	
-	  goto try_next_page;
+	  /* We need to check if this is a vorbis packet, if so we are assuming we are 
+	   * at a bitstream boundary and need to reset the decoder. But if its a
+	   * non-vorbis packet or an packet whose serialno is not known from the header
+	   * we simply skip it.
+	   */
+	  for (i = 0; i < vf->obilen; ++i) {
+	    if (vf->obi[i].serialno==ogg_page_serialno(&og))
+	      break;
+	  }
+	  if (i<vf->obilen && memcmp(vf->obi[i].signature+1, "vorbis", 6))
+	    goto try_next_page;
 	  if(!spanp)
 	    return(OV_EOF);
 



More information about the commits mailing list