Hi engkin,
Thanks for your response.
I followed your lead and bypassed the LCL component and tried compiling the test program provided (testlcl.lpi). This program ran (slowly) and then failed because it could not load the VLC dll 'libvlccore.dll'.
I found the code to load the VLC dlls in 'libvlc.pp' in the fpc\3.0.0.0\source\packages\libvlc\src folder.
Obviously, that code needed changing but, sensing that I was walking on thin ice, before making any changes, I copied the test program files together with libvlc.pp, vlc.pp and lclvlc.pp into a single new folder and renamed them all. I then changed the constant 'DefaultLibPath' (in what used to be 'libvlc.pp') to point at the correct program folder and compiled.
Now, when running the compiled program from the IDE, it again seems to run very slowly but it does load the VLC dlls. Though sluggish, it works up to the point of clicking on the 'Play' button when it seems to hang. Task Manager shows 'gdb.exe' (which I assume is the debugger?) is taking 50% of the CPU but the program itself does nothing.
At this point, I tried running the newly compiled program outside the IDE. Hey presto, it works! It doesn't feel sluggish and the video plays almost instantaneously.
While I was typing the above, the version of the program running under the IDE (which I had left 'running' in the background) surprised me by suddenly bursting into life and playing the video. I was curious, so I recompiled and re-ran the program under the IDE with a stopwatch in hand and found that, from clicking on the 'play' button to the video actually starting took 6 minutes 21 seconds. All this time gdb.exe was taking around 50% of the CPU (i.e. 100% of one of the two processor cores).
So, after all that, I'm not at all sure what I've proved but there's obviously something quite odd going on.