summaryrefslogtreecommitdiffstats
path: root/src/portaudio-1-fixes-crlf.patch
blob: dc56494d22d50c5679078ff498db38330e1189a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 19e458bb064fbccadecced9c20f5c05c65018c2c Mon Sep 17 00:00:00 2001
From: MXE
Date: Tue, 30 Jun 2015 21:21:17 -0400
Subject: [PATCH 1/2] pa_win_ds: Add shim for macro


diff --git a/src/hostapi/dsound/pa_win_ds.c b/src/hostapi/dsound/pa_win_ds.c
index 98afb5c..2b24981 100644
--- a/src/hostapi/dsound/pa_win_ds.c
+++ b/src/hostapi/dsound/pa_win_ds.c
@@ -876,6 +876,9 @@ static PaError AddOutputDeviceInfoFromDirectSound(
                             case DSSPEAKER_STEREO:           count = 2; break;
                             case DSSPEAKER_SURROUND:         count = 4; break;
                             case DSSPEAKER_5POINT1:          count = 6; break;
+#ifndef DSSPEAKER_7POINT1
+#define DSSPEAKER_7POINT1 0x00000007
+#endif
                             case DSSPEAKER_7POINT1:          count = 8; break;
 #ifndef DSSPEAKER_7POINT1_SURROUND
 #define DSSPEAKER_7POINT1_SURROUND 0x00000008
@@ -2108,7 +2111,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
         }
         else
         {
-            CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames,
+            CalculateBufferSettings( (unsigned long*)&stream->hostBufferSizeFrames,
+                    &pollingPeriodFrames,
                     /* isFullDuplex = */ (inputParameters && outputParameters),
                     suggestedInputLatencyFrames,
                     suggestedOutputLatencyFrames, 
-- 
1.9.1


From 4cec0d1cc47fcf3dd71fded3678282981d5d4f74 Mon Sep 17 00:00:00 2001
From: MXE
Date: Tue, 30 Jun 2015 21:25:55 -0400
Subject: [PATCH 2/2] pa_win_wasapi: Fix compilation on mingw-w64


diff --git a/configure.in b/configure.in
index 3f3b31e..dc84918 100644
--- a/configure.in
+++ b/configure.in
@@ -337,7 +337,7 @@ case "${host_os}" in
             add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o
             LIBS="${LIBS} -lwinmm -lm -lole32 -luuid"
             DLL_LIBS="${DLL_LIBS} -lwinmm -lole32"
-            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
+            CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
         fi
         ;;
 
diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c
index aecdd63..a9473b9 100644
--- a/src/hostapi/wasapi/pa_win_wasapi.c
+++ b/src/hostapi/wasapi/pa_win_wasapi.c
@@ -49,14 +49,15 @@
 #include <assert.h>
 #include <mmsystem.h>
 #include <mmreg.h>  // must be before other Wasapi headers
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-	#include <Avrt.h>
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW64_VERSION_MAJOR)
+	#include <avrt.h>
 	#define COBJMACROS
-	#include <Audioclient.h>
+	#include <audioclient.h>
 	#include <endpointvolume.h>
 	#define INITGUID // Avoid additional linkage of static libs, excessive code will be optimized out by the compiler
-	#include <mmdeviceapi.h>
+	#include <functiondiscoverykeys_devpkey.h>
 	#include <functiondiscoverykeys.h>
+	#include <mmdeviceapi.h>
     #include <devicetopology.h>	// Used to get IKsJackDescription interface
 	#undef INITGUID
 #endif
-- 
1.9.1