[vlc-commits] mft: Do not use LoadLibrary when building for Vista and later

Hugo Beauzée-Luyssen git at videolan.org
Fri Nov 21 17:36:52 CET 2014


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Nov 21 13:13:08 2014 +0100| [d04d1ee345d30f665fc9c9f155b8a1d984ba2a5b] | committer: Hugo Beauzée-Luyssen

mft: Do not use LoadLibrary when building for Vista and later

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d04d1ee345d30f665fc9c9f155b8a1d984ba2a5b
---

 modules/codec/mft.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/codec/mft.c b/modules/codec/mft.c
index 4777e8b..67a3dd6 100644
--- a/modules/codec/mft.c
+++ b/modules/codec/mft.c
@@ -1088,6 +1088,7 @@ static int FindMFT(decoder_t *p_dec)
 
 static int LoadMFTLibrary(MFHandle *mf)
 {
+#if _WINNT_VER < 0x601
     mf->mfplat_dll = LoadLibrary(TEXT("mfplat.dll"));
     if (!mf->mfplat_dll)
         return VLC_EGENERIC;
@@ -1098,6 +1099,12 @@ static int LoadMFTLibrary(MFHandle *mf)
     mf->fptr_MFCreateAlignedMemoryBuffer = (void*)GetProcAddress(mf->mfplat_dll, "MFCreateAlignedMemoryBuffer");
     if (!mf->fptr_MFTEnumEx || !mf->fptr_MFCreateSample || !mf->fptr_MFCreateMemoryBuffer || !mf->fptr_MFCreateAlignedMemoryBuffer)
         return VLC_EGENERIC;
+#else
+    mf->fptr_MFTEnumEx = &MFTEnumEx;
+    mf->fptr_MFCreateSample = &MFCreateSample;
+    mf->fptr_MFCreateMemoryBuffer = &MFCreateMemoryBuffer;
+    mf->fptr_MFCreateAlignedMemoryBuffer = &MFCreateAlignedMemoryBuffer;
+#endif
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list