Windows - libvlc_new returning 0
Posted: 30 May 2014 12:18
Sorry to trouble folks on this topic where I have seen a few responses. I think I am trying the suggestions, but seem to have the same problem.
I am using VS 2010 and trying to use libvlc for the first time.
Here is the code below -
Elsewhere in the code, I am setting the environment variable for the vlc-plugin directory. I am delay loading the libvlc library so that the environment variable for the plugin directory is set before the call to the library. You can see that I am checking the value before the call to the library. You can also see from the output below that the library is being loaded later.
What am I doing wrong - how can I get past this simple first step so that I can actually learn to use the library.
Thanks
I am using VS 2010 and trying to use libvlc for the first time.
Here is the code below -
Code: Select all
LRESULT OnBtn1(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
char* sPath = new char[256];
DWORD dwRet = GetEnvironmentVariableA("VLC_PLUGIN_PATH",sPath,255);
ATLTRACE(_T("\nVLC_PLUGIN_PATH is: "));
ATLTRACE(sPath);
ATLTRACE(_T("\n\nLibvlc.dll loaded after this ** \n\n"));
libvlc_instance_t * inst;
/* Load the VLC engine */
inst = libvlc_new (0, NULL);
ATLTRACE(_T("libvlc_new returned %x\n"),inst);
MessageBeep(MB_ICONINFORMATION);
MessageBeep(MB_ICONINFORMATION);
libvlc_release (inst);
return 0;
}
Code: Select all
VLC_PLUGIN_PATH is: C:\Program Files\VideoLan\VLC\plugins
Libvlc.dll loaded after this **
'VLC_1.exe': Loaded 'E:\Projects\VLC_1\VLC_1\Debug\libvlc.dll', Binary was not built with debug information.
'VLC_1.exe': Loaded 'E:\Projects\VLC_1\VLC_1\Debug\libvlccore.dll', Binary was not built with debug information.
'VLC_1.exe': Loaded 'C:\Windows\System32\shell32.dll', Symbols loaded (source information stripped).
'VLC_1.exe': Loaded 'C:\Windows\System32\winmm.dll', Symbols loaded (source information stripped).
'VLC_1.exe': Loaded 'C:\Windows\System32\ws2_32.dll', Symbols loaded (source information stripped).
'VLC_1.exe': Loaded 'C:\Windows\System32\nsi.dll', Symbols loaded (source information stripped).
main libvlc error: No plugins found! Check your VLC installation.
libvlc_new returned 0
Thanks