Commit 6b64e009 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dsound: Kill SecondaryBufferImpl with extreme prejudice.

parent 7da80d1f
......@@ -1630,15 +1630,10 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
}
hres = IDirectSoundBufferImpl_Create(device, &dsb, dsbd);
if (dsb) {
hres = SecondaryBufferImpl_Create(dsb, (SecondaryBufferImpl**)ppdsb);
if (*ppdsb) {
dsb->secondary = (SecondaryBufferImpl*)*ppdsb;
IDirectSoundBuffer_AddRef(*ppdsb);
} else
WARN("SecondaryBufferImpl_Create failed\n");
} else
WARN("IDirectSoundBufferImpl_Create failed\n");
if (dsb)
*ppdsb = (IDirectSoundBuffer*)&dsb->IDirectSoundBuffer8_iface;
else
WARN("IDirectSoundBufferImpl_Create failed\n");
}
return hres;
......@@ -1676,18 +1671,11 @@ HRESULT DirectSoundDevice_DuplicateSoundBuffer(
}
/* duplicate the actual buffer implementation */
hres = IDirectSoundBufferImpl_Duplicate(device, &dsb,
((SecondaryBufferImpl *)psb)->dsb);
if (hres == DS_OK) {
/* create a new secondary buffer using the new implementation */
hres = SecondaryBufferImpl_Create(dsb, (SecondaryBufferImpl**)ppdsb);
if (*ppdsb) {
dsb->secondary = (SecondaryBufferImpl*)*ppdsb;
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)*ppdsb);
} else
WARN("SecondaryBufferImpl_Create failed\n");
}
hres = IDirectSoundBufferImpl_Duplicate(device, &dsb, (IDirectSoundBufferImpl*)psb);
if (hres == DS_OK)
*ppdsb = (IDirectSoundBuffer*)&dsb->IDirectSoundBuffer8_iface;
else
WARN("IDirectSoundBufferImpl_Duplicate failed\n");
return hres;
}
......
......@@ -58,7 +58,6 @@ typedef struct IDirectSound3DListenerImpl IDirectSound3DListenerImpl;
typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl;
typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl;
typedef struct PrimaryBufferImpl PrimaryBufferImpl;
typedef struct SecondaryBufferImpl SecondaryBufferImpl;
typedef struct DirectSoundDevice DirectSoundDevice;
typedef struct DirectSoundCaptureDevice DirectSoundCaptureDevice;
......@@ -162,7 +161,6 @@ struct IDirectSoundBufferImpl
IDirectSoundBuffer8 IDirectSoundBuffer8_iface;
LONG ref;
/* IDirectSoundBufferImpl fields */
SecondaryBufferImpl* secondary;
DirectSoundDevice* device;
RTL_RWLOCK lock;
PIDSDRIVERBUFFER hwbuf;
......@@ -210,20 +208,6 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
IDirectSoundBufferImpl *pdsb) DECLSPEC_HIDDEN;
/*****************************************************************************
* SecondaryBuffer implementation structure
*/
struct SecondaryBufferImpl
{
const IDirectSoundBuffer8Vtbl *lpVtbl;
LONG ref;
IDirectSoundBufferImpl* dsb;
};
HRESULT SecondaryBufferImpl_Create(
IDirectSoundBufferImpl *dsb,
SecondaryBufferImpl **pdsb) DECLSPEC_HIDDEN;
/*****************************************************************************
* PrimaryBuffer implementation structure
*/
struct PrimaryBufferImpl
......
......@@ -710,8 +710,6 @@ HRESULT IDirectSound3DBufferImpl_Create(
ds3db->dsb->ds3db_need_recalc = TRUE;
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)dsb);
*pds3db = ds3db;
return S_OK;
}
......
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