From: Ziqing Hui zhui@codeweavers.com
--- dlls/winegstreamer/color_convert.c | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index 4b60628e8ba..21d2aa67e64 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -360,6 +360,22 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags);
+ if (!type) + { + if (impl->input_type) + { + IMFMediaType_Release(impl->input_type); + impl->input_type = NULL; + } + if (impl->wg_transform) + { + wg_transform_destroy(impl->wg_transform); + impl->wg_transform = 0; + } + + return S_OK; + } + if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) return MF_E_ATTRIBUTENOTFOUND; @@ -422,6 +438,22 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
TRACE("iface %p, id %#lx, type %p, flags %#lx.\n", iface, id, type, flags);
+ if (!type) + { + if (impl->output_type) + { + IMFMediaType_Release(impl->output_type); + impl->output_type = NULL; + } + if (impl->wg_transform) + { + wg_transform_destroy(impl->wg_transform); + impl->wg_transform = 0; + } + + return S_OK; + } + if (FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_MAJOR_TYPE, &major)) || FAILED(hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &subtype))) return MF_E_ATTRIBUTENOTFOUND;