[xiph-cvs] cvs commit: vorbis-python/src pyvorbiscodec.c pyvorbisfile.c pyvorbisinfo.c vorbismodule.c

Andrew Catham Master of Python andrew at xiph.org
Sat Jan 18 16:50:48 PST 2003



andrew      03/01/18 19:50:48

  Modified:    .        ChangeLog setup.py
               src      pyvorbiscodec.c pyvorbisfile.c pyvorbisinfo.c
                        vorbismodule.c
  Log:
  2003-1-18   Andrew H. Chatham <pyogg at andrewchatham.com>
          * Applied a patch from Nicodemus <nicodemus at globalite.com.br> to
          get this to build on windows.

Revision  Changes    Path
1.19      +4 -0      vorbis-python/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/ChangeLog,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ChangeLog	25 Sep 2002 05:49:02 -0000	1.18
+++ ChangeLog	19 Jan 2003 00:50:48 -0000	1.19
@@ -1,3 +1,7 @@
+2003-1-18   Andrew H. Chatham <pyogg at andrewchatham.com>
+	* Applied a patch from Nicodemus <nicodemus at globalite.com.br> to 
+	get this to build on windows.
+	
 2002-09-24  Andrew H. Chatham <pyogg at andrewchatham.com>
         * Changes from Neil Blakey-Milner
         * setup.py - fixed regular expression

<p><p>1.10      +2 -2      vorbis-python/setup.py

Index: setup.py
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/setup.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- setup.py	25 Sep 2002 05:49:02 -0000	1.9
+++ setup.py	19 Jan 2003 00:50:48 -0000	1.10
@@ -7,7 +7,7 @@
 from distutils.extension import Extension
 
 VERSION_MAJOR = 1
-VERSION_MINOR = 1
+VERSION_MINOR = 2
 pyvorbis_version = str(VERSION_MAJOR) + '.' + str(VERSION_MINOR)
 
 try:
@@ -48,7 +48,7 @@
 ogg_include_dir = data['ogg_include_dir']
 ogg_lib_dir = data['ogg_lib_dir']
 
-vorbismodule = Extension(name='vorbismodule',
+vorbismodule = Extension(name='vorbis',
                          sources=['src/vorbismodule.c',
                                   'src/pyvorbisfile.c',
                                   'src/pyvorbiscodec.c',

<p><p>1.7       +10 -10    vorbis-python/src/pyvorbiscodec.c

Index: pyvorbiscodec.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/src/pyvorbiscodec.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pyvorbiscodec.c	18 Feb 2002 01:16:34 -0000	1.6
+++ pyvorbiscodec.c	19 Jan 2003 00:50:48 -0000	1.7
@@ -13,19 +13,19 @@
                          VorbisDSP Object
  **************************************************************/
 
-FDEF(vorbis_analysis_headerout) "Create three header packets for an ogg\n\
-stream, given an optional comment object.";
+FDEF(vorbis_analysis_headerout) "Create three header packets for an ogg\n"
+"stream, given an optional comment object.";
 FDEF(vorbis_analysis_blockout) "Output a VorbisBlock. Data must be written to the object first.";
 
 FDEF(vorbis_block_init) "Create a VorbisBlock object for use in encoding {more?!}";
-FDEF(dsp_write) "Write audio data to the dsp device and have it analyzed. \n\
-Each argument must be a string containing the audio data for a\n\
-single channel.\n
-If None is passed as the only argument, this will signal that no more\n
-data needs to be written.";
-FDEF(dsp_write_wav) "Write audio data to the dsp device and have it analyzed.\n\
-The single argument is the output from the python wave module. Only supports\n\
-16-bit wave data (8-bit waves will produce garbage).";
+FDEF(dsp_write) "Write audio data to the dsp device and have it analyzed. \n"
+"Each argument must be a string containing the audio data for a\n"
+"single channel.\n"
+"If None is passed as the only argument, this will signal that no more\n"
+"data needs to be written.";
+FDEF(dsp_write_wav) "Write audio data to the dsp device and have it analyzed.\n"
+"The single argument is the output from the python wave module. Only supports\n"
+"16-bit wave data (8-bit waves will produce garbage).";
 FDEF(dsp_close) "Signal that all audio data has been written to the object.";
 FDEF(vorbis_bitrate_flushpacket) "";
 

<p><p>1.8       +6 -0      vorbis-python/src/pyvorbisfile.c

Index: pyvorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/src/pyvorbisfile.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- pyvorbisfile.c	25 Sep 2002 05:49:02 -0000	1.7
+++ pyvorbisfile.c	19 Jan 2003 00:50:48 -0000	1.8
@@ -1,6 +1,12 @@
 #include <stdio.h>
+#ifndef _WIN32
 #include <endian.h>
 #include <assert.h>
+#else
+#define LITTLE_ENDIAN 0
+#define BIG_ENDIAN 1
+#define BYTE_ORDER LITTLE_ENDIAN     
+#endif
 
 #include "general.h"
 #include "vorbismodule.h"

<p><p>1.14      +25 -2     vorbis-python/src/pyvorbisinfo.c

Index: pyvorbisinfo.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/src/pyvorbisinfo.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- pyvorbisinfo.c	12 Sep 2002 07:15:40 -0000	1.13
+++ pyvorbisinfo.c	19 Jan 2003 00:50:48 -0000	1.14
@@ -671,6 +671,29 @@
   return PyInt_FromLong(vorbis_comment_query_count(vc, tag));
 }
 
+/* We need this for Win32, so I'll implement it rather than use
+   strcasecmp on Linux */
+static int pystrcasecmp(const char *str1, const char *str2) {
+  int k = 0;
+  while (str1[k] != '\0' && str2[k] != '\0') {
+    char c1 = str1[k];
+    char c2 = str2[k];
+    if (c1 >= 'A' && c1 <= 'Z') {
+      c1 = c1 - 'A' + 'a';
+    }
+    if (c2 >= 'A' && c1 <= 'Z') {
+      c2 = c1 - 'A' + 'a';
+    }
+    if (c1 < c2) {
+      return -1;
+    } else if (c1 > c2) {
+      return 1;
+    }
+    ++k;
+  }
+  return 0;
+}
+
 static int
 make_caps_key(char *in, int size)
 {
@@ -704,7 +727,7 @@
                     "Setting comment with non-string object");
     return 0;
   }
-  if (!strcasecmp(key, "vendor")) {
+  if (!pystrcasecmp(key, "vendor")) {
     vcomment->vendor = strdup(tag_str);
   } else {
     int k;
@@ -744,7 +767,7 @@
     return assign_tag(vcomment, key, item_vals);
   } else if (PySequence_Check(item_vals)) {
     int j, val_length = PySequence_Length(item_vals);
-    if (!strcasecmp(key, "vendor") && val_length > 1) {
+    if (!pystrcasecmp(key, "vendor") && val_length > 1) {
       PyErr_SetString(PyExc_ValueError, "Cannot have multiple vendor tags");
     }
     for (j = 0; j < val_length; j++) {

<p><p>1.4       +1 -1      vorbis-python/src/vorbismodule.c

Index: vorbismodule.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/src/vorbismodule.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vorbismodule.c	21 May 2002 21:43:14 -0000	1.3
+++ vorbismodule.c	19 Jan 2003 00:50:48 -0000	1.4
@@ -106,7 +106,7 @@
                        PyString_FromString(docstring));
 
   PyDict_SetItemString(dict, "__version__", 
-		       PyString_FromString(VERSION));
+		       PyString_FromString("1.2"));
 
   if (PyErr_Occurred())
     PyErr_SetString(PyExc_ImportError, 

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