[xiph-commits] r17374 - trunk/Tremor

tterribe at svn.xiph.org tterribe at svn.xiph.org
Tue Aug 31 11:51:41 PDT 2010


Author: tterribe
Date: 2010-08-31 11:51:40 -0700 (Tue, 31 Aug 2010)
New Revision: 17374

Modified:
   trunk/Tremor/Version_script.in
   trunk/Tremor/ivorbiscodec.h
   trunk/Tremor/synthesis.c
   trunk/Tremor/vorbisfile.c
Log:
Remove the extra argument from vorbis_synthesis().

Add vorbis_synthesis_trackonly() instead, so that this part of the API works
 like mainline libvorbis now.


Modified: trunk/Tremor/Version_script.in
===================================================================
--- trunk/Tremor/Version_script.in	2010-08-31 18:37:07 UTC (rev 17373)
+++ trunk/Tremor/Version_script.in	2010-08-31 18:51:40 UTC (rev 17374)
@@ -51,6 +51,7 @@
 		vorbis_synthesis_init;
 		vorbis_synthesis_restart;
 		vorbis_synthesis;
+		vorbis_synthesis_trackonly;
 		vorbis_synthesis_blockin;
 		vorbis_synthesis_pcmout;
 		vorbis_synthesis_read;

Modified: trunk/Tremor/ivorbiscodec.h
===================================================================
--- trunk/Tremor/ivorbiscodec.h	2010-08-31 18:37:07 UTC (rev 17373)
+++ trunk/Tremor/ivorbiscodec.h	2010-08-31 18:51:40 UTC (rev 17374)
@@ -171,7 +171,8 @@
 
 extern int      vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
 extern int      vorbis_synthesis_restart(vorbis_dsp_state *v);
-extern int      vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep);
+extern int      vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
+extern int      vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
 extern int      vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
 extern int      vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm);
 extern int      vorbis_synthesis_read(vorbis_dsp_state *v,int samples);

Modified: trunk/Tremor/synthesis.c
===================================================================
--- trunk/Tremor/synthesis.c	2010-08-31 18:37:07 UTC (rev 17373)
+++ trunk/Tremor/synthesis.c	2010-08-31 18:51:40 UTC (rev 17374)
@@ -24,7 +24,7 @@
 #include "misc.h"
 #include "block.h"
 
-int vorbis_synthesis(vorbis_block *vb,ogg_packet *op,int decodep){
+static int _vorbis_synthesis1(vorbis_block *vb,ogg_packet *op,int decodep){
   vorbis_dsp_state     *vd=vb->vd;
   private_state        *b=(private_state *)vd->backend_state;
   vorbis_info          *vi=vd->vi;
@@ -82,6 +82,14 @@
   }
 }
 
+int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
+  return _vorbis_synthesis1(vb,op,1);
+}
+
+int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op){
+  return _vorbis_synthesis1(vb,op,0);
+}
+
 long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){
   codec_setup_info     *ci=(codec_setup_info *)vi->codec_setup;
   oggpack_buffer       opb;

Modified: trunk/Tremor/vorbisfile.c
===================================================================
--- trunk/Tremor/vorbisfile.c	2010-08-31 18:37:07 UTC (rev 17373)
+++ trunk/Tremor/vorbisfile.c	2010-08-31 18:51:40 UTC (rev 17374)
@@ -714,13 +714,13 @@
 	if(result>0){
 	  /* got a packet.  process it */
 	  granulepos=op.granulepos;
-	  if(!vorbis_synthesis(&vf->vb,&op,1)){ /* lazy check for lazy
-						      header handling.  The
-						      header packets aren't
-						      audio, so if/when we
-						      submit them,
-						      vorbis_synthesis will
-						      reject them */
+          if(!vorbis_synthesis(&vf->vb,&op)){ /* lazy check for lazy
+                                                 header handling.  The
+                                                 header packets aren't
+                                                 audio, so if/when we
+                                                 submit them,
+                                                 vorbis_synthesis will
+                                                 reject them */
 
 	    /* suck in the synthesis data and track bitrate */
 	    {
@@ -1580,9 +1580,9 @@
       
       /* remove the packet from packet queue and track its granulepos */
       ogg_stream_packetout(vf->os,NULL);
-      vorbis_synthesis(&vf->vb,&op,0);  /* set up a vb with
-					   only tracking, no
-					   pcm_decode */
+      vorbis_synthesis_trackonly(&vf->vb,&op);  /* set up a vb with
+                                                   only tracking, no
+                                                   pcm_decode */
       vorbis_synthesis_blockin(&vf->vd,&vf->vb); 
       
       /* end of logical stream case is hard, especially with exact



More information about the commits mailing list