[Bug 31258] Could not initialize DirectSound...

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Sep 7 06:22:21 CDT 2012


http://bugs.winehq.org/show_bug.cgi?id=31258

Maarten Lankhorst <m.b.lankhorst at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED
                 CC|                            |m.b.lankhorst at gmail.com

--- Comment #21 from Maarten Lankhorst <m.b.lankhorst at gmail.com> 2012-09-07 06:22:21 CDT ---
Thanks, sorry for the bug, my dsound modifications attempt to aggressively use
float to reduce mixing overhead, the patch below tests if float is actually
available before using it and should be incorporated in the next ubuntu wine
ppa release.

diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index ddd41ae..1869c8e 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -91,10 +91,18 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL
forcewave)
             }

             if (!IsEqualGUID(&wfe->SubFormat,
&KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) {
+                WAVEFORMATEXTENSIBLE wfe3 = *wfe;
+
                 wfe->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
                 w->wBitsPerSample = 32;
                 wfe->Samples.wValidBitsPerSample = 0;

+                if (FAILED(IAudioClient_IsFormatSupported(device->client,
AUDCLNT_SHAREMODE_SHARED, &wfe->Format, (WAVEFORMATEX**)&wfe2)))
+                    *wfe = wfe3;
+                else if (wfe2)
+                    *wfe = *wfe2;
+                CoTaskMemFree(wfe2);
+                wfe2 = NULL;
             }
             w->nBlockAlign = w->nChannels * w->wBitsPerSample / 8;
             w->nAvgBytesPerSec = w->nBlockAlign * w->nSamplesPerSec;

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list