From ea06a42d57994227ba5d9f99e9b479655406fdbd Mon Sep 17 00:00:00 2001 From: ronag Date: Wed, 30 Nov 2011 17:50:55 +0000 Subject: [PATCH] git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.2@1729 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- modules/bluefish/util/blue_velvet.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/modules/bluefish/util/blue_velvet.cpp b/modules/bluefish/util/blue_velvet.cpp index ae938082f..afc81cb9d 100644 --- a/modules/bluefish/util/blue_velvet.cpp +++ b/modules/bluefish/util/blue_velvet.cpp @@ -17,10 +17,17 @@ BLUE_UINT32 (*encode_hanc_frame_ex)(BLUE_UINT32 card_type, struct hanc_stream_in void blue_velvet_initialize() { #ifdef _DEBUG - auto module = LoadLibrary(L"BlueVelvet3_d.dll"); + std::string module_str = "BlueVelvet3_d.dll"; #else - auto module = LoadLibrary(L"BlueVelvet3.dll"); + std::string module_str = "BlueVelvet3.dll"; #endif + std::string sys_drive = getenv("SystemDrive"); + + auto module = LoadLibraryA(module_str.c_str()); + if(!module) + LoadLibraryA((sys_drive + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str()); + if(!module) + LoadLibraryA((sys_drive + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str()); if(!module) BOOST_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueVelvet3.dll. Required drivers are not installed.")); static std::shared_ptr lib(module, FreeLibrary); @@ -32,10 +39,18 @@ void blue_velvet_initialize() void blue_hanc_initialize() { #ifdef _DEBUG - auto module = LoadLibrary(L"BlueHancUtils_d.dll"); + std::string module_str = "BlueHancUtils_d.dll"; #else - auto module = LoadLibrary(L"BlueHancUtils.dll"); + std::string module_str = "BlueHancUtils.dll"; #endif + + std::string sys_drive = getenv("SystemDrive"); + + auto module = LoadLibraryA(module_str.c_str()); + if(!module) + LoadLibraryA((sys_drive + "\\Program Files\\Bluefish444\\Driver\\" + module_str).c_str()); + if(!module) + LoadLibraryA((sys_drive + "\\Program Files (x86)\\BlueFish444\\Driver\\" + module_str).c_str()); if(!module) BOOST_THROW_EXCEPTION(file_not_found() << msg_info("Could not find BlueHancUtils.dll. Required drivers are not installed.")); static std::shared_ptr lib(module, FreeLibrary); @@ -45,8 +60,8 @@ void blue_hanc_initialize() void blue_initialize() { - blue_velvet_initialize(); blue_hanc_initialize(); + blue_velvet_initialize(); } EVideoMode vid_fmt_from_video_format(const core::video_format::type& fmt) -- 2.39.2