windowscodecs: Use IWICComponentFactory_CreateQueryReaderFromBlockReader in GetMetadataQueryReader.

Instead of MetadataQueryReader_CreateInstance.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-01-25 10:20:15 +01:00 committed by Alexandre Julliard
parent 8fad0b146d
commit b44fb04759
1 changed files with 14 additions and 1 deletions

View File

@ -433,6 +433,8 @@ static HRESULT WINAPI CommonDecoderFrame_GetMetadataQueryReader(IWICBitmapFrameD
IWICMetadataQueryReader **ppIMetadataQueryReader)
{
CommonDecoderFrame *This = impl_from_IWICBitmapFrameDecode(iface);
IWICComponentFactory* factory;
HRESULT hr;
TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader);
@ -442,7 +444,18 @@ static HRESULT WINAPI CommonDecoderFrame_GetMetadataQueryReader(IWICBitmapFrameD
if (!(This->parent->file_info.flags & WICBitmapDecoderCapabilityCanEnumerateMetadata))
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
return MetadataQueryReader_CreateInstance(&This->IWICMetadataBlockReader_iface, NULL, ppIMetadataQueryReader);
hr = create_instance(&CLSID_WICImagingFactory, &IID_IWICComponentFactory, (void**)&factory);
if (SUCCEEDED(hr))
{
hr = IWICComponentFactory_CreateQueryReaderFromBlockReader(factory, &This->IWICMetadataBlockReader_iface, ppIMetadataQueryReader);
IWICComponentFactory_Release(factory);
}
if (FAILED(hr))
*ppIMetadataQueryReader = NULL;
return hr;
}
static HRESULT WINAPI CommonDecoderFrame_GetColorContexts(IWICBitmapFrameDecode *iface,