[vlc-devel] Enhancement Request...

jboileau jboileau at gmail.com
Fri Apr 4 16:19:53 CEST 2008


I agree but there is a wayaround this if libvlc and libvlc-control remain in
the same directory in the future which is very likely I assume. If we want
to go to that much trouble is debatable but here is the solution I believe
would work:

1. Use delay load when linking libvlc to libvlc-control (see here:
http://www.codeproject.com/KB/DLL/Delay_Loading_Dll.aspx and here:
http://msdn2.microsoft.com/en-us/library/151kt790(VS.80).aspx

2. When libvlc-control starts, before any calls to libvlc is done, do:
             - GetModuleFilename and extract the path portion
             - Do a LoadLibray of libvlc using that path.

3. Now that libvlc is already loaded, the first call to libvlc should find
it already in memory and not search for it on disk.

4. When libvlc-control unload`s, do a UnloadLibrary of libvlc
Jacques Boileau
On Fri, Apr 4, 2008 at 9:22 AM, Remi Denis-Courmont <rdenis at simphalempin.com>
wrote:

> hmm, that does not work, I think. LibVLC!could learn its install path and
> infer the locations of plugins (and even shared data files) from it. Because
> it calls dlopen or the non-portable equivalent for these. I did file an
> enhancement ticket for this a while ago.
>
> However, it is NOT possible for LibVLC-control to learn the location of
> LibVLC. The earlier is linked to the latter at build link-time, not
> run-time. It is hence the OS loader that needs to know the path, not
> LibVLC-control.
>
> Remi Denis
>
> -- message original --
> Sujet:  Re: [vlc-devel] Enhancement Request...
> De:     jboileau <jboileau at gmail.com>
> Date:           04.04.2008 13:03
>
> Well we don't really package anything. The application I work on is
> embedded and I create compact flash images to hold everything. So its
> not a really big problem for me and its transparent to the end user. I
> offer my experience mostly to help if it can. I see all the hard work
> you guys put in, its the least I can when I read emails I can comment
> on to do so.
>
> But the only way to package everything up to not have the path problem
> would be to put VLC in the same directory as our application. Which I
> would rather not. It is nice to have VLC in its own directory and our
> stuff in another. Easier to update one without the other. And easier
> in the development stage. Visual Studio creates directories for
> release and debug builds. I would have to add post-build steps to copy
> the VLC files to the target dir when I run the app from the IDE. Do I
> want this copy to happen every time I build? No way!
>
> It ain't a big deal to do a set current dir to the VLC install dir so
> that the VLC DLLs can find each other. I could also add the VLC dir to
> the environment path. But it would also be easy to have
> libvlc-control.dll know its dir and use it to find libvlc.dll. This
> problem is very minor and easily circumventable in my environment. I
> am sure there are more important issues.
>
> Jacques Boileau
>
> On Thu, Apr 3, 2008 at 9:05 PM, Pierre d'Herbemont <pdherbemont at free.fr>
> wrote:
> >
> > On Apr 3, 2008, at 8:48 PM, jboileau wrote:
> > > Hi,
> > >
> > > I can probably help since I develop on Windows. It is true that there
> > > is problem loading libvlc-control.dll on Windows. Personaly for the
> > > moment I am reading the VLC install path from the registry, do a set
> > > current dir to there, load libvlc and finally load libvlc-control (see
> > > code below). This is the only way I have found to make it work without
> > > problems.
> >
> > Why don't you package libvlc and plugin with your own app?
> >
> >
> > Pierre.
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > http://mailman.videolan.org/listinfo/vlc-devel
> >
>
>
>
> --
> Jacques Boileau
>  _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>



-- 
Jacques Boileau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080404/39da9885/attachment.html>


More information about the vlc-devel mailing list