From 542bd73ba83978345ed2e99356ba7857f5c9c528 Mon Sep 17 00:00:00 2001 From: hyperiris Date: Fri, 27 Mar 2009 14:12:59 +0000 Subject: [PATCH] Well, it should fix audio, at least on my machine. need test git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2761 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/AudioCommon/Src/DSoundStream.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/AudioCommon/Src/DSoundStream.cpp b/Source/Core/AudioCommon/Src/DSoundStream.cpp index 4f98433826..b3ff5941b6 100644 --- a/Source/Core/AudioCommon/Src/DSoundStream.cpp +++ b/Source/Core/AudioCommon/Src/DSoundStream.cpp @@ -19,7 +19,10 @@ #include #include "DSoundStream.h" +#include "../../../PluginSpecs/pluginspecs_dsp.h" + //extern bool log_ai; +extern DSPInitialize g_dspInitialize; bool DSound::CreateBuffer() { @@ -41,6 +44,7 @@ bool DSound::CreateBuffer() dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_STICKYFOCUS; dsbdesc.dwBufferBytes = bufferSize = BUFSIZE; dsbdesc.lpwfxFormat = (WAVEFORMATEX *)&pcmwf; + dsbdesc.guid3DAlgorithm = DS3DALG_DEFAULT; HRESULT res = ds->CreateSoundBuffer(&dsbdesc, &dsBuffer, NULL); if (SUCCEEDED(res)) @@ -103,7 +107,8 @@ void DSound::SoundLoop() { currentPos = 0; lastPos = 0; - dsBuffer->Play(0, 0, DSBPLAY_LOOPING); + + HRESULT hr = dsBuffer->Play(0, 0, DSBPLAY_LOOPING); while (!threadData) { // No blocking inside the csection @@ -135,8 +140,10 @@ bool DSound::Start() soundSyncEvent.Init(); if (FAILED(DirectSoundCreate8(0, &ds, 0))) return false; - if (hWnd) - ds->SetCooperativeLevel((HWND)hWnd, DSSCL_NORMAL); + if (g_dspInitialize.hWnd) + { + HRESULT hr = ds->SetCooperativeLevel((HWND)g_dspInitialize.hWnd, DSSCL_PRIORITY); + } if (!CreateBuffer()) return false;