Commit 545124d3 authored by Erwan Tulou's avatar Erwan Tulou

mft: fix probe issue with GUI threads

The skins2 thread as a Gui interface uses OLE/COM set up as 'appartment threaded' for DragNDrop. This thread also uses the vlc decoding facilities to decode still images and therefore is likely to probe decoder modules.

Calling CoInitializeEx() in multithreaded mode is not compatible with the already 'appartment threaded' setting, and therefore fails. In debug mode, this causes an unreachable assert. In non debug mode, the Open() is executed, fails and calls an undue CoUninitialize() which silently breaks the whole OLE setting of the thread.

The patch just gracefully returns on failure.
parent b4e31d4b
......@@ -1121,7 +1121,10 @@ static int Open(vlc_object_t *p_this)
return VLC_ENOMEM;
if( FAILED(CoInitializeEx(NULL, COINIT_MULTITHREADED)) )
vlc_assert_unreachable();
{
free(p_sys);
return VLC_EGENERIC;
}
if (LoadMFTLibrary(&p_sys->mf_handle))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment