quartz: Start DirectSound renderer as soon as possible.

Makes directsound switch to silent playback even when no buffers are
playing, fixes glitching on starting playback from a stopped buffer.
This commit is contained in:
Maarten Lankhorst 2010-11-11 14:03:28 +01:00 committed by Alexandre Julliard
parent cf085af126
commit 64b14c0ecd

View File

@ -457,6 +457,19 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
ERR("Cannot create Direct Sound object (%x)\n", hr);
else
hr = IDirectSound_SetCooperativeLevel(pDSoundRender->dsound, GetDesktopWindow(), DSSCL_PRIORITY);
if (SUCCEEDED(hr)) {
IDirectSoundBuffer *buf;
DSBUFFERDESC buf_desc;
memset(&buf_desc,0,sizeof(DSBUFFERDESC));
buf_desc.dwSize = sizeof(DSBUFFERDESC);
buf_desc.dwFlags = DSBCAPS_PRIMARYBUFFER;
hr = IDirectSound_CreateSoundBuffer(pDSoundRender->dsound, &buf_desc, &buf, NULL);
if (SUCCEEDED(hr)) {
IDirectSoundBuffer_Play(buf, 0, 0, DSBPLAY_LOOPING);
IUnknown_Release(buf);
}
hr = S_OK;
}
}
if (SUCCEEDED(hr))