[xiph-commits] r15346 - in trunk/vorbis: include/vorbis lib

ivo at svn.xiph.org ivo at svn.xiph.org
Sun Sep 28 11:06:01 PDT 2008


Author: ivo
Date: 2008-09-28 11:06:00 -0700 (Sun, 28 Sep 2008)
New Revision: 15346

Modified:
   trunk/vorbis/include/vorbis/codec.h
   trunk/vorbis/lib/info.c
Log:
define GENERAL_VENDOR_STRING and ENCODE_VENDOR_STRING.  Patch by Aoyumi.

Modified: trunk/vorbis/include/vorbis/codec.h
===================================================================
--- trunk/vorbis/include/vorbis/codec.h	2008-09-28 17:43:00 UTC (rev 15345)
+++ trunk/vorbis/include/vorbis/codec.h	2008-09-28 18:06:00 UTC (rev 15346)
@@ -179,6 +179,8 @@
 extern double   vorbis_granule_time(vorbis_dsp_state *v,
 				    ogg_int64_t granulepos);
 
+extern const char *vorbis_version_string(void);
+
 /* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
 
 extern int      vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);

Modified: trunk/vorbis/lib/info.c
===================================================================
--- trunk/vorbis/lib/info.c	2008-09-28 17:43:00 UTC (rev 15345)
+++ trunk/vorbis/lib/info.c	2008-09-28 18:06:00 UTC (rev 15346)
@@ -31,6 +31,9 @@
 #include "misc.h"
 #include "os.h"
 
+#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.2.1"
+#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20080501"
+
 /* helpers */
 static int ilog2(unsigned int v){
   int ret=0;
@@ -457,8 +460,7 @@
 }
 
 static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
-  char temp[]="Xiph.Org libVorbis I 20080501";
-  int bytes = strlen(temp);
+  int bytes = strlen(ENCODE_VENDOR_STRING);
 
   /* preamble */  
   oggpack_write(opb,0x03,8);
@@ -466,8 +468,8 @@
 
   /* vendor */
   oggpack_write(opb,bytes,32);
-  _v_writestring(opb,temp, bytes);
-  
+  _v_writestring(opb,ENCODE_VENDOR_STRING, bytes);
+
   /* comments */
 
   oggpack_write(opb,vc->comments,32);
@@ -648,3 +650,7 @@
     return((double)granulepos/v->vi->rate);
   return(-1);
 }
+
+const char *vorbis_version_string(void){
+  return GENERAL_VENDOR_STRING;
+}



More information about the commits mailing list