Commit bb72548f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dsound: Use a better name for IDirectSoundBufferImpl_Create().

parent d51d55ba
...@@ -983,19 +983,15 @@ static const IDirectSoundBuffer8Vtbl dsbvt = ...@@ -983,19 +983,15 @@ static const IDirectSoundBuffer8Vtbl dsbvt =
IDirectSoundBufferImpl_GetObjectInPath IDirectSoundBufferImpl_GetObjectInPath
}; };
HRESULT IDirectSoundBufferImpl_Create( HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *dsbd,
DirectSoundDevice * device, IDirectSoundBuffer **buffer)
IDirectSoundBufferImpl **pdsb,
LPCDSBUFFERDESC dsbd)
{ {
IDirectSoundBufferImpl *dsb; IDirectSoundBufferImpl *dsb;
LPWAVEFORMATEX wfex = dsbd->lpwfxFormat; LPWAVEFORMATEX wfex = dsbd->lpwfxFormat;
HRESULT err = DS_OK; HRESULT err = DS_OK;
DWORD capf = 0; DWORD capf = 0;
TRACE("(%p,%p,%p)\n",device,pdsb,dsbd); TRACE("(%p,%p,%p)\n", device, dsbd, buffer);
*pdsb = NULL;
if (dsbd->dwBufferBytes < DSBSIZE_MIN || dsbd->dwBufferBytes > DSBSIZE_MAX) { if (dsbd->dwBufferBytes < DSBSIZE_MIN || dsbd->dwBufferBytes > DSBSIZE_MAX) {
WARN("invalid parameter: dsbd->dwBufferBytes = %d\n", dsbd->dwBufferBytes); WARN("invalid parameter: dsbd->dwBufferBytes = %d\n", dsbd->dwBufferBytes);
...@@ -1107,14 +1103,12 @@ HRESULT IDirectSoundBufferImpl_Create( ...@@ -1107,14 +1103,12 @@ HRESULT IDirectSoundBufferImpl_Create(
RtlInitializeResource(&dsb->lock); RtlInitializeResource(&dsb->lock);
/* register buffer if not primary */ /* register buffer */
if (!(dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER)) { err = DirectSoundDevice_AddBuffer(device, dsb);
err = DirectSoundDevice_AddBuffer(device, dsb); if (err == DS_OK)
if (err == DS_OK) *buffer = (IDirectSoundBuffer*)&dsb->IDirectSoundBuffer8_iface;
*pdsb = dsb; else
else IDirectSoundBuffer8_Release(&dsb->IDirectSoundBuffer8_iface);
IDirectSoundBuffer8_Release(&dsb->IDirectSoundBuffer8_iface);
}
return err; return err;
} }
......
...@@ -469,8 +469,6 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer( ...@@ -469,8 +469,6 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer(
WARN("primarybuffer_create() failed\n"); WARN("primarybuffer_create() failed\n");
} }
} else { } else {
IDirectSoundBufferImpl * dsb;
if (dsbd->lpwfxFormat == NULL) { if (dsbd->lpwfxFormat == NULL) {
WARN("invalid parameter: dsbd->lpwfxFormat can't be NULL for " WARN("invalid parameter: dsbd->lpwfxFormat can't be NULL for "
"secondary buffer\n"); "secondary buffer\n");
...@@ -547,9 +545,8 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer( ...@@ -547,9 +545,8 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer(
return DSERR_INVALIDPARAM; return DSERR_INVALIDPARAM;
} }
hres = IDirectSoundBufferImpl_Create(device, &dsb, dsbd); hres = secondarybuffer_create(device, dsbd, ppdsb);
if (dsb) { if (SUCCEEDED(hres)) {
*ppdsb = (IDirectSoundBuffer*)&dsb->IDirectSoundBuffer8_iface;
if (dsbd->dwFlags & DSBCAPS_LOCHARDWARE) if (dsbd->dwFlags & DSBCAPS_LOCHARDWARE)
device->drvcaps.dwFreeHwMixingAllBuffers--; device->drvcaps.dwFreeHwMixingAllBuffers--;
} else } else
......
...@@ -182,10 +182,8 @@ void put_stereo2quad(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel ...@@ -182,10 +182,8 @@ void put_stereo2quad(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel
void put_mono2surround51(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; void put_mono2surround51(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN;
void put_stereo2surround51(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN; void put_stereo2surround51(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel, float value) DECLSPEC_HIDDEN;
HRESULT IDirectSoundBufferImpl_Create( HRESULT secondarybuffer_create(DirectSoundDevice *device, const DSBUFFERDESC *dsbd,
DirectSoundDevice *device, IDirectSoundBuffer **buffer) DECLSPEC_HIDDEN;
IDirectSoundBufferImpl **ppdsb,
LPCDSBUFFERDESC dsbd) DECLSPEC_HIDDEN;
HRESULT IDirectSoundBufferImpl_Duplicate( HRESULT IDirectSoundBufferImpl_Duplicate(
DirectSoundDevice *device, DirectSoundDevice *device,
IDirectSoundBufferImpl **ppdsb, IDirectSoundBufferImpl **ppdsb,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment