Windows - libvlc_new returning 0

This forum is about all development around libVLC.
rajas
New Cone
New Cone
Posts: 2
Joined: 30 May 2014 12:08

Windows - libvlc_new returning 0

Postby rajas » 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 -

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; }
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.

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
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

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Windows - libvlc_new returning 0

Postby Rémi Denis-Courmont » 01 Jun 2014 15:05

Don't bother with the environment. It is a mess to get right especially on Windows with potentially mismatched C run-times. Just put the plugins in the plugins subdirectory from where libvlccore.dll is.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

rajas
New Cone
New Cone
Posts: 2
Joined: 30 May 2014 12:08

Re: Windows - libvlc_new returning 0

Postby rajas » 03 Jun 2014 05:05

Thanks, it turns out that I had left a copy of the libvlccore.dll in the project directory - thus it found that rather than the one in the path. Once I removed that, it did find the plugin directory and libvlc_new returned a value. Now I can begin to learn to use the library.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests