Andrew Eikum : xaudio2: Try to increase OpenAL source limit.

Alexandre Julliard julliard at winehq.org
Wed Apr 19 14:49:38 CDT 2017


Module: wine
Branch: master
Commit: 986a14f9500dd0abf598703a775e2e610594200c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=986a14f9500dd0abf598703a775e2e610594200c

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Mon Apr 17 13:14:58 2017 -0500

xaudio2: Try to increase OpenAL source limit.

openal-soft recently added support for applications to request new
source count limits. Older versions will silently ignore these
attributes.

Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/xaudio2_7/xaudio_dll.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index b2a5e3b..a091629 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -1593,7 +1593,7 @@ static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface,
     IMMDevice *dev;
     HRESULT hr;
     WAVEFORMATEX *fmt;
-    ALCint attrs[7];
+    ALCint attrs[11];
     REFERENCE_TIME period, bufdur;
 
     TRACE("(%p)->(%p, %u, %u, 0x%x, %s, %p, 0x%x)\n", This,
@@ -1743,11 +1743,20 @@ static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface,
         LeaveCriticalSection(&This->lock);
         return AUDCLNT_E_UNSUPPORTED_FORMAT;
     }
+
     attrs[2] = ALC_FREQUENCY;
     attrs[3] = inputSampleRate;
+
     attrs[4] = ALC_FORMAT_TYPE_SOFT;
     attrs[5] = al_get_loopback_format(&This->fmt);
-    attrs[6] = 0;
+
+    /* some games create very many sources */
+    attrs[6] = ALC_STEREO_SOURCES;
+    attrs[7] = 1024;
+    attrs[8] = ALC_MONO_SOURCES;
+    attrs[9] = 1024;
+
+    attrs[10] = 0;
 
     if(!attrs[5]){
         WARN("OpenAL can't output samples in this format\n");




More information about the wine-cvs mailing list