mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-07 07:00:48 +00:00
camera: small Media Foundation backend init tweak.
This commit is contained in:
parent
e290d16c47
commit
bafd04ecdb
1 changed files with 8 additions and 9 deletions
|
|
@ -1084,25 +1084,24 @@ static SDL_bool MEDIAFOUNDATION_Init(SDL_CameraDriverImpl *impl)
|
|||
LOADSYM(mfreadwrite, MFCreateSourceReaderFromMediaSource);
|
||||
#undef LOADSYM
|
||||
|
||||
if (okay) {
|
||||
const HRESULT ret = pMFStartup(MF_VERSION, MFSTARTUP_LITE);
|
||||
if (FAILED(ret)) {
|
||||
okay = SDL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!okay) {
|
||||
FreeLibrary(mfreadwrite);
|
||||
FreeLibrary(mfplat);
|
||||
FreeLibrary(mf);
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
libmf = mf;
|
||||
libmfplat = mfplat;
|
||||
libmfreadwrite = mfreadwrite;
|
||||
|
||||
const HRESULT ret = pMFStartup(MF_VERSION, MFSTARTUP_LITE);
|
||||
if (FAILED(ret)) {
|
||||
FreeLibrary(libmfplat);
|
||||
libmfplat = NULL;
|
||||
FreeLibrary(libmf);
|
||||
libmf = NULL;
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
impl->DetectDevices = MEDIAFOUNDATION_DetectDevices;
|
||||
impl->OpenDevice = MEDIAFOUNDATION_OpenDevice;
|
||||
impl->CloseDevice = MEDIAFOUNDATION_CloseDevice;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue