Page 1 of 1

Is there a way to pre-load plugins and pre-initialize VLC?

Posted: 14 Jul 2008 20:17
by corvusvideo
On some slower systems when a user plays the first video there is often a time where audio plays but no video, then video finally starts. After that all videos start immediately. I assume that during this time VLC is still initializing, or loading plugins.

Is there any call I can make, or any other way that I can make VLC do its initial operation while I display an appropriate "working" message so that the first video plays from the beginning?

Thanks.....

RKM

Re: Is there a way to pre-load plugins and pre-initialize VLC?

Posted: 15 Jul 2008 13:27
by corvusvideo
I found by trial and error that doing a "LoadLibrary" on all the DLLs will force them into the DLL cache and perform any virus checks your system does. Putting up a "working" message during this step seems to make for a better user experience. If anyone knows a better way, or a built-in method in libvlc I would like to hear about it. Thanks.

Code: Select all

[DllImport("kernel32")] static extern IntPtr LoadLibrary(string lpFileName); public void PreloadPlugins(String pStartupPath) { LoadLibrary(pStartupPath + @"\libvlccore.dll"); LoadLibrary(pStartupPath + @"\libvlc.dll"); string[] dlls = Directory.GetFiles(pStartupPath + @"\plugins", "*.dll"); foreach (String dll in dlls) { LoadLibrary(dll); } }

Maximum startup speed

Posted: 16 Jul 2008 18:18
by corvusvideo
OK. The preloading the DLLs trick helps a little bit but not nearly so much as using the following options:

Code: Select all

string[] args = new string[] { "-I", "dummy", "--plugins-cache", "--minimize-threads", "--no-reset-plugins-cache", "--high-priority" };
Running with these options resulted in the fastest startup and play I was able to achieve (BTW I am using 0.9.0 libvlc).

Any other ideas gratefully received.

RKM