From 9abc50f6ade1e94acedcce874ff16312c3ba3cb5 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 5 Aug 2011 11:19:47 -0700 Subject: [PATCH] Rename DS8Primary_Create and DS8Primary_Destroy Since they don't create and destroy the object anymore, and instead just do some pre-initialization and clearing work, respectively. --- dsound8.c | 4 ++-- dsound_private.h | 4 ++-- primary.c | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dsound8.c b/dsound8.c index a9f375a9191..5203b77f82c 100644 --- a/dsound8.c +++ b/dsound8.c @@ -364,7 +364,7 @@ HRESULT DSOUND_Create8(REFIID riid, LPVOID *ds) static void DS8Impl_Destroy(DS8Impl *This) { - DS8Primary_Destroy(&This->primary); + DS8Primary_Clear(&This->primary); if(This->share) DSShare_Release(This->share); This->share = NULL; @@ -883,7 +883,7 @@ static HRESULT WINAPI DS8_Initialize(IDirectSound8 *iface, const GUID *devguid) if(SUCCEEDED(hr)) { This->device = This->share->device; - hr = DS8Primary_Create(&This->primary, This); + hr = DS8Primary_PreInit(&This->primary, This); } if(FAILED(hr)) diff --git a/dsound_private.h b/dsound_private.h index 3e8694f9074..2b51635a0a1 100644 --- a/dsound_private.h +++ b/dsound_private.h @@ -539,8 +539,8 @@ struct DS8Buffer { DSBPOSITIONNOTIFY *notify; }; -extern HRESULT DS8Primary_Create(DS8Primary *prim, DS8Impl *parent); -extern void DS8Primary_Destroy(DS8Primary *prim); +extern HRESULT DS8Primary_PreInit(DS8Primary *prim, DS8Impl *parent); +extern void DS8Primary_Clear(DS8Primary *prim); extern HRESULT DS8Buffer_Create(DS8Buffer **ppv, DS8Primary *parent, IDirectSoundBuffer *orig); extern void DS8Buffer_Destroy(DS8Buffer *buf); diff --git a/primary.c b/primary.c index ffc9b345b70..00f5adae1f9 100644 --- a/primary.c +++ b/primary.c @@ -68,6 +68,7 @@ static const IDirectSoundBufferVtbl DS8Primary_Vtbl; static const IDirectSound3DListenerVtbl DS8Primary3D_Vtbl; static const IKsPropertySetVtbl DS8PrimaryProp_Vtbl; + static void AL_APIENTRY wrap_DeferUpdates(void) { alcSuspendContext(alcGetCurrentContext()); } static void AL_APIENTRY wrap_ProcessUpdates(void) @@ -217,7 +218,7 @@ static DWORD CALLBACK ThreadProc(void *dwUser) } -HRESULT DS8Primary_Create(DS8Primary *This, DS8Impl *parent) +HRESULT DS8Primary_PreInit(DS8Primary *This, DS8Impl *parent) { DS3DLISTENER *listener; WAVEFORMATEX *wfx; @@ -305,13 +306,13 @@ HRESULT DS8Primary_Create(DS8Primary *This, DS8Impl *parent) return S_OK; fail: - DS8Primary_Destroy(This); + DS8Primary_Clear(This); return hr; } -void DS8Primary_Destroy(DS8Primary *This) +void DS8Primary_Clear(DS8Primary *This) { - TRACE("Destroying primary %p\n", This); + TRACE("Clearing primary %p\n", This); if(!This->parent) return; -- 2.11.4.GIT