Module: wine Branch: master Commit: c34eb9693346d1cfa071db53a28e8c3283dd1aa2 URL: https://gitlab.winehq.org/wine/wine/-/commit/c34eb9693346d1cfa071db53a28e8c3...
Author: Ziqing Hui zhui@codeweavers.com Date: Wed Jun 26 16:27:44 2024 +0800
winegstreamer/color_converter: Support clearing media types.
---
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;