shithub: sox

Download patch

ref: 7633af3c8826efa2ae799a64c65855aded814145
parent: 619cfdbc66b626b436dfa9b378440f44bac8039e
author: Rob Sykes <robs@users.sourceforge.net>
date: Fri Mar 9 03:16:42 EST 2012

fixes to bit-rot support files and cmake build files

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,7 @@
 project(sox)
 
 if(CMAKE_COMPILER_IS_GNUCC)
-  add_definitions(-D_FORTIFY_SOURCE=2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic)
+	add_definitions(-D_FORTIFY_SOURCE=2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic -Wno-format -Wno-long-long)
 endif(CMAKE_COMPILER_IS_GNUCC)
 
 include(TestBigEndian)
@@ -135,6 +135,7 @@
 endif (HAVE_PNG)
 optional2(HAVE_PULSEAUDIO pulse/simple.h pulse-simple pa_simple_new pulse pa_strerror pulseaudio)
 optional(HAVE_SNDFILE sndfile.h sndfile sf_open_virtual sndfile)
+optional(HAVE_SNDFILE sndfile.h sndfile sf_open_virtual caf)
 optional(HAVE_SNDFILE sndfile.h sndfile sf_open_virtual fap)
 optional(HAVE_SNDFILE sndfile.h sndfile sf_open_virtual mat4)
 optional(HAVE_SNDFILE sndfile.h sndfile sf_open_virtual mat5)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -139,7 +139,7 @@
 
 # Uncomment for bit-rot detection on linux
 #set(formats_srcs ${formats_srcs} coreaudio sndio sunaudio waveaudio)
-#add_definitions(-Isrc/bit-rot)
+#add_definitions(-Ibit-rot)
 
 add_library(lib${PROJECT_NAME}
   effects                 formats_i               libsox_i
--- a/src/bit-rot/CoreAudio/CoreAudio.h
+++ b/src/bit-rot/CoreAudio/CoreAudio.h
@@ -158,9 +158,14 @@
 };
 
 enum {
-  kAudioHardwareNoError = 0
+  kAudioHardwareNoError = 0,
+  noErr = kAudioHardwareNoError
 };
 
+enum {
+  false
+};
+
 typedef double Float64;
 typedef float Float32;
 typedef int SInt32;
@@ -239,6 +244,10 @@
 
 
 OSStatus AudioHardwareGetProperty(AudioHardwarePropertyID inPropertyID,
+                                  UInt32 * ioPropertyDataSize,
+                                  void *outPropertyData);
+
+OSStatus AudioHardwareGetPropertyInfo(AudioHardwarePropertyID inPropertyID,
                                   UInt32 * ioPropertyDataSize,
                                   void *outPropertyData);
 
--- a/src/bit-rot/mmsystem.h
+++ b/src/bit-rot/mmsystem.h
@@ -5,11 +5,14 @@
 #define HWAVEOUT HANDLE
 #define MMRESULT UINT
 #define MMVERSION UINT
+#define UNALIGNED
 
 enum {
   MMSYSERR_NOERROR,
   MAXPNAMELEN,
   WAVE_FORMAT_PCM,
+  WAVE_FORMAT_EXTENSIBLE,
+  WAVE_FORMAT_QUERY,
   WAVE_MAPPER,
   WAVERR_STILLPLAYING,
   WHDR_DONE,
@@ -73,3 +76,14 @@
 MMRESULT WINAPI waveOutPrepareHeader(HWAVEOUT,LPWAVEHDR,UINT);
 MMRESULT WINAPI waveOutReset(HWAVEOUT);
 MMRESULT WINAPI waveOutWrite(HWAVEOUT,LPWAVEHDR,UINT);
+
+typedef struct {
+  WAVEFORMATEX Format;
+  union {
+    WORD wValidBitsPerSample;
+    WORD wSamplesPerBlock;
+    WORD wReserved;
+  } Samples;
+  DWORD        dwChannelMask;
+  GUID         SubFormat;
+} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
--- a/src/bit-rot/windows.h
+++ b/src/bit-rot/windows.h
@@ -16,6 +16,7 @@
 #define WINAPI
 #define WIN_BOOL int
 #define WORD uint16_t
+typedef char GUID[16];
 
 enum {
   FALSE,
--- a/src/soxconfig.h.cmake
+++ b/src/soxconfig.h.cmake
@@ -38,6 +38,7 @@
 #cmakedefine HAVE_SNDFILE             1
 #cmakedefine HAVE_SNDFILE_1_0_18      1
 #cmakedefine HAVE_SNDIO               1
+#cmakedefine HAVE_SPEEXDSP            1
 #cmakedefine HAVE_STDINT_H            1
 #cmakedefine HAVE_STRCASECMP          1
 #cmakedefine HAVE_STRING_H            1