Some programs just assume this interface exists, this fixes the resulting crash.
From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55789 --- dlls/winegstreamer/resampler.c | 45 ++++++++++++++++++++++++++++++++++ include/wmcodecdsp.idl | 11 +++++++++ 2 files changed, 56 insertions(+)
diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index df39d1a1e07..86050458d8a 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -41,6 +41,7 @@ struct resampler IMediaObject IMediaObject_iface; IPropertyBag IPropertyBag_iface; IPropertyStore IPropertyStore_iface; + IWMResamplerProps IWMResamplerProps_iface; IUnknown *outer; LONG refcount;
@@ -97,6 +98,8 @@ static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID iid, void * *out = &impl->IPropertyBag_iface; else if (IsEqualIID(iid, &IID_IPropertyStore)) *out = &impl->IPropertyStore_iface; + else if (IsEqualIID(iid, &IID_IWMResamplerProps)) + *out = &impl->IWMResamplerProps_iface; else { *out = NULL; @@ -872,6 +875,47 @@ static const IPropertyStoreVtbl property_store_vtbl = property_store_Commit, };
+static inline struct resampler *impl_from_IWMResamplerProps(IWMResamplerProps *iface) +{ + return CONTAINING_RECORD(iface, struct resampler, IWMResamplerProps_iface); +} + +static HRESULT WINAPI resampler_props_QueryInterface(IWMResamplerProps *iface, REFIID iid, void **out) +{ + return IUnknown_QueryInterface(impl_from_IWMResamplerProps(iface)->outer, iid, out); +} + +static ULONG WINAPI resampler_props_AddRef(IWMResamplerProps *iface) +{ + return IUnknown_AddRef(impl_from_IWMResamplerProps(iface)->outer); +} + +static ULONG WINAPI resampler_props_Release(IWMResamplerProps *iface) +{ + return IUnknown_Release(impl_from_IWMResamplerProps(iface)->outer); +} + +static HRESULT WINAPI resampler_props_SetHalfFilterLength(IWMResamplerProps *iface, LONG lhalfFilterLen) +{ + FIXME("iface %p, count %lu stub!\n", iface, lhalfFilterLen); + return E_NOTIMPL; +} + +static HRESULT WINAPI resampler_props_SetUserChannelMtx(IWMResamplerProps *iface, ChMtxType* userChannelMtx) +{ + FIXME("iface %p, userChannelMtx %p stub!\n", iface, userChannelMtx); + return E_NOTIMPL; +} + +static const IWMResamplerPropsVtbl resampler_props_vtbl = +{ + resampler_props_QueryInterface, + resampler_props_AddRef, + resampler_props_Release, + resampler_props_SetHalfFilterLength, + resampler_props_SetUserChannelMtx, +}; + HRESULT resampler_create(IUnknown *outer, IUnknown **out) { static const struct wg_format input_format = @@ -924,6 +968,7 @@ HRESULT resampler_create(IUnknown *outer, IUnknown **out) impl->IMediaObject_iface.lpVtbl = &media_object_vtbl; impl->IPropertyBag_iface.lpVtbl = &property_bag_vtbl; impl->IPropertyStore_iface.lpVtbl = &property_store_vtbl; + impl->IWMResamplerProps_iface.lpVtbl = &resampler_props_vtbl; impl->refcount = 1; impl->outer = outer ? outer : &impl->IUnknown_inner;
diff --git a/include/wmcodecdsp.idl b/include/wmcodecdsp.idl index 5769b0e011e..7a1690e239f 100644 --- a/include/wmcodecdsp.idl +++ b/include/wmcodecdsp.idl @@ -91,3 +91,14 @@ coclass CWMVDecMediaObject {} uuid(7e320092-596a-41b2-bbeb-175d10504eb6) ] coclass CWMVXEncMediaObject {} + +typedef float ChMtxType; + +[ + uuid(e7e9984f-f09f-4da4-903f-6e2e0efe56b5), +] +interface IWMResamplerProps : IUnknown +{ + HRESULT SetHalfFilterLength(LONG lhalfFilterLen); + HRESULT SetUserChannelMtx(ChMtxType* userChannelMtx); +}
Zebediah Figura (@zfigura) commented about include/wmcodecdsp.idl:
uuid(7e320092-596a-41b2-bbeb-175d10504eb6)
] coclass CWMVXEncMediaObject {}
+typedef float ChMtxType;
+[
- uuid(e7e9984f-f09f-4da4-903f-6e2e0efe56b5),
+]
This should have [local] and [object].
Zebediah Figura (@zfigura) commented about include/wmcodecdsp.idl:
uuid(7e320092-596a-41b2-bbeb-175d10504eb6)
] coclass CWMVXEncMediaObject {}
+typedef float ChMtxType;
+[
- uuid(e7e9984f-f09f-4da4-903f-6e2e0efe56b5),
+] +interface IWMResamplerProps : IUnknown +{
- HRESULT SetHalfFilterLength(LONG lhalfFilterLen);
- HRESULT SetUserChannelMtx(ChMtxType* userChannelMtx);
+}
Can we please use better parameter names here, and fix the asterisk placement?