From e3c27194580a69416868af235ce5a93cb311c299 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 12 May 2012 23:59:40 +0000 Subject: [PATCH] - fixed build on windows --- .../sources/graphics/video_player.cpp | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/source/shared_lib/sources/graphics/video_player.cpp b/source/shared_lib/sources/graphics/video_player.cpp index e28a0f2fd..6ee5e4894 100644 --- a/source/shared_lib/sources/graphics/video_player.cpp +++ b/source/shared_lib/sources/graphics/video_player.cpp @@ -14,6 +14,9 @@ #include #include #include +#if defined(WIN32) +#include +#endif #ifdef HAS_LIBVLC #include @@ -154,26 +157,19 @@ void VideoPlayer::PlayVideo() { */ libvlc = libvlc_new(vlc_argc, &vlc_argv[0]); if(libvlc == NULL) { - // For windows check registry for install path #if defined(WIN32) && !defined(__MINGW32__) - // example from: http://stackoverflow.com/questions/1387769/create-registry-entry-to-associate-file-extension-with-application-in-c - //[HKEY_CURRENT_USER\Software\Classes\blergcorp.blergapp.v1\shell\open\command] - //@="c:\path\to\app.exe \"%1\"" - //[HKEY_CURRENT_USER\Software\Classes\.blerg] - //@="blergcorp.blergapp.v1" - //Open the registry key. wstring subKey = L"Software\\VideoLAN\\VLC"; HKEY keyHandle; - DWORD dwDisposition; + //DWORD dwDisposition; LONG lres = RegOpenKeyEx(HKEY_LOCAL_MACHINE,subKey.c_str(),0, KEY_READ, &keyHandle); if(lres == ERROR_SUCCESS) { std::string strValue; //GetStringRegKey(keyHandle, L"", strValue, L""); - WCHAR szBuffer[4096]; + char szBuffer[4096]; DWORD dwBufferSize = sizeof(szBuffer); - ULONG nError = RegQueryValueEx(keyHandle, "", 0, NULL, (LPBYTE)szBuffer, &dwBufferSize); + ULONG nError = RegQueryValueEx(keyHandle, L"", 0, NULL, (LPBYTE)szBuffer, &dwBufferSize); if (ERROR_SUCCESS == nError) { strValue = szBuffer; } @@ -182,10 +178,10 @@ void VideoPlayer::PlayVideo() { if(strValue != "") { #if defined(WIN32) - strValue = "VLC_PLUGIN_PATH="strValue; + strValue = "VLC_PLUGIN_PATH=" + strValue; _putenv(strValue.c_str()); #else - setenv("VLC_PLUGIN_PATH","c:\\program files\\videolan\\vlc\\plugins",1); + setenv("VLC_PLUGIN_PATH",strValue.c_str(),1); #endif libvlc = libvlc_new(vlc_argc, &vlc_argv[0]); }