xaudio2_8: Don't use IXAudio27 interface to call Initialize.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ff8f129af6
commit
fb954b7b9f
|
@ -468,7 +468,7 @@ static HRESULT WINAPI XA27_Initialize(IXAudio27 *iface, UINT32 flags,
|
|||
{
|
||||
IXAudio2Impl *This = impl_from_IXAudio27(iface);
|
||||
TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor);
|
||||
return S_OK;
|
||||
return xaudio2_initialize(This, flags, processor);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI XA27_RegisterForCallbacks(IXAudio27 *iface,
|
||||
|
@ -1305,7 +1305,7 @@ static HRESULT WINAPI XA22_Initialize(IXAudio22 *iface, UINT32 flags,
|
|||
{
|
||||
IXAudio2Impl *This = impl_from_IXAudio22(iface);
|
||||
TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor);
|
||||
return S_OK;
|
||||
return xaudio2_initialize(This, flags, processor);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI XA22_RegisterForCallbacks(IXAudio22 *iface,
|
||||
|
@ -2163,7 +2163,7 @@ static HRESULT WINAPI XA20_Initialize(IXAudio20 *iface, UINT32 flags,
|
|||
{
|
||||
IXAudio2Impl *This = impl_from_IXAudio20(iface);
|
||||
TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor);
|
||||
return S_OK;
|
||||
return xaudio2_initialize(This, flags, processor);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI XA20_RegisterForCallbacks(IXAudio20 *iface,
|
||||
|
|
|
@ -2046,14 +2046,22 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
|
|||
return IClassFactory_QueryInterface(factory, riid, ppv);
|
||||
}
|
||||
|
||||
HRESULT xaudio2_initialize(IXAudio2Impl *This, UINT32 flags, XAUDIO2_PROCESSOR proc)
|
||||
{
|
||||
if(flags)
|
||||
FIXME("Unimplemented flags: 0x%x\n", flags);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#if XAUDIO2_VER >= 8
|
||||
HRESULT WINAPI XAudio2Create(IXAudio2 **ppxa2, UINT32 flags, XAUDIO2_PROCESSOR proc)
|
||||
{
|
||||
HRESULT hr;
|
||||
IXAudio2 *xa2;
|
||||
IXAudio27 *xa27;
|
||||
IClassFactory *cf;
|
||||
|
||||
TRACE("%p 0x%x 0x%x\n", ppxa2, flags, proc);
|
||||
|
||||
cf = make_xaudio2_factory();
|
||||
|
||||
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IXAudio2, (void**)&xa2);
|
||||
|
@ -2061,21 +2069,12 @@ HRESULT WINAPI XAudio2Create(IXAudio2 **ppxa2, UINT32 flags, XAUDIO2_PROCESSOR p
|
|||
if(FAILED(hr))
|
||||
return hr;
|
||||
|
||||
hr = IXAudio2_QueryInterface(xa2, &IID_IXAudio27, (void**)&xa27);
|
||||
hr = xaudio2_initialize(impl_from_IXAudio2(xa2), flags, proc);
|
||||
if(FAILED(hr)){
|
||||
IXAudio2_Release(xa2);
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = IXAudio27_Initialize(xa27, flags, proc);
|
||||
if(FAILED(hr)){
|
||||
IXAudio27_Release(xa27);
|
||||
IXAudio2_Release(xa2);
|
||||
return hr;
|
||||
}
|
||||
|
||||
IXAudio27_Release(xa27);
|
||||
|
||||
*ppxa2 = xa2;
|
||||
|
||||
return S_OK;
|
||||
|
|
|
@ -150,3 +150,4 @@ extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN;
|
|||
extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN;
|
||||
|
||||
extern IClassFactory *make_xapo_factory(REFCLSID clsid) DECLSPEC_HIDDEN;
|
||||
extern HRESULT xaudio2_initialize(IXAudio2Impl *This, UINT32 flags, XAUDIO2_PROCESSOR proc) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue