Skip to content
Snippets Groups Projects
Commit 0411ae06 authored by Steve Lhomme's avatar Steve Lhomme
Browse files

d3d11_fmt: use a context_mutex for external devices too

If the owner doesn't set the GUID_CONTEXT_MUTEX we should still have a mutex
when we want to use the device with a hardware decoder.

The owner of the ID3D11DeviceContext doesn't need to set the mutex if it
doesn't use the ID3D11DeviceContext outside of the callbacks called by libvlc.
parent f3b16b6f
No related branches found
No related tags found
No related merge requests found
......@@ -366,6 +366,13 @@ static HRESULT D3D11_CreateDeviceExternal(vlc_object_t *obj, ID3D11DeviceContext
hr = ID3D11DeviceContext_GetPrivateData(d3d11ctx, &GUID_CONTEXT_MUTEX, &dataSize, &context_lock);
if (SUCCEEDED(hr))
out->context_mutex = context_lock;
else if (hw_decoding)
{
out->mutex_owner = true;
out->context_mutex = CreateMutexEx( NULL, NULL, 0, SYNCHRONIZE );
ID3D11DeviceContext_SetPrivateData( out->d3dcontext, &GUID_CONTEXT_MUTEX,
sizeof( out->context_mutex ), &out->context_mutex );
}
else
out->context_mutex = INVALID_HANDLE_VALUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment