windowscodecs: Add fallback to unknown metadata reader.
This commit is contained in:
parent
1dee37340d
commit
fa455f594b
|
@ -1050,7 +1050,30 @@ start:
|
|||
IEnumUnknown_Release(enumreaders);
|
||||
|
||||
if (!*reader && !(options & WICMetadataCreationFailUnknown))
|
||||
FIXME("create unknown metadata reader\n");
|
||||
{
|
||||
hr = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
hr = UnknownMetadataReader_CreateInstance(&IID_IWICMetadataReader, (void**)reader);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IWICMetadataReader_QueryInterface(*reader, &IID_IWICPersistStream, (void**)&wicpersiststream);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IWICPersistStream_LoadEx(wicpersiststream, stream, NULL, options & WICPersistOptionsMask);
|
||||
|
||||
IWICPersistStream_Release(wicpersiststream);
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
IWICMetadataReader_Release(*reader);
|
||||
*reader = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*reader)
|
||||
return S_OK;
|
||||
|
|
|
@ -876,7 +876,7 @@ static void test_create_reader(void)
|
|||
hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory,
|
||||
&GUID_ContainerFormatWmp, NULL, WICPersistOptionsDefault,
|
||||
stream, &reader);
|
||||
todo_wine ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
|
||||
ok(hr == S_OK, "CreateMetadataReaderFromContainer failed, hr=%x\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue