Page 1 of 1

vlc 2.2.0 fails to create instance on Mac

Posted: 03 Mar 2015 15:10
by lanamelach
Hello. I am using libvlc in my application that runs on windows and mac. I've recently upgraded vlc to 2.2.0. On Windows there are seem to be no issues after that, but on Mac it fails to create a vlc instance. Namely, libvlc_new(0, NULL) returns a NULL pointer, also the error message "[[32;1m0000000103e01338[0m] core libvlc error: [31;1mNo plugins found! Check your VLC installation.[0m" is printed to the Xcode log. VLC 2.1.5 works fine, so that must be something related to the latest changes.

At least one wrong thing that I've noticed is the bad symbolic link: libvlccore.dylib points to libvlccore.7.dylib, although there is no such a file nearby, instead there is libvlccore.8.dylib. However, fixing that did not solve my problem.

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 04 Mar 2015 10:24
by Jean-Baptiste Kempf
Your plugins are not packaged, I guess.

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 04 Mar 2015 11:06
by lanamelach
What do you mean 'plugins not packaged'? Let's say VLC is installed at /Applications/VLC.app. Here goes the small sample code that shows the issue:

Code: Select all

#include <QtCore> struct libvlc_instance_t; //libvlc_instance_t * libvlc_new( int argc , const char *const *argv ); typedef libvlc_instance_t * (*PLibvlcNew)(int argc , const char *const *argv); int main(int argc, char * argv[]) { QCoreApplication app(argc, argv); QLibrary lib("/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib"); if (!lib.load()) { qDebug() << "Failed to load libvlc"; return -1; } PLibvlcNew pLibvlcNew = (PLibvlcNew)lib.resolve("libvlc_new"); if (!pLibvlcNew) { qDebug() << "Failed to resolve libvlc_new"; return -2; } libvlc_instance_t * vlcInstance = pLibvlcNew(0, NULL); if (!vlcInstance) { qDebug() << "Failed to create vlc instance"; return -3; } return app.exec(); }
The program fails when calling pLibvlcNew(0, NULL) printing the aforementioned message about plugins.

If I replace VLC 2.2.0 with VLC 2.1.5, it works fine.

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 04 Mar 2015 23:30
by Jean-Baptiste Kempf
Your plugins are not in the application .app package like in VLC.app

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 05 Mar 2015 07:21
by lanamelach
Ok, what plugins should I place and where? Why wasn't it needed for previous vlc versions?

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 05 Mar 2015 10:40
by klaas2
Dear Jean, perhaps you can give one more hint? As I seem to have the same issue....

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 05 Mar 2015 15:38
by RSATom
What else libvlc related files except libvlc.dylib did you place to your .app package?

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 05 Mar 2015 15:56
by lanamelach
I tried two ways:
1) placing everything from VLC.app\Contents\MacOS to my .app
2) not placing any files to the .app (even libvlc.dylib), but using libvlc from /Applications/VLC.app

Both ways it worked for vlc 2.1.5 and older versions. Neither way it works for vlc 2.2.0.

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 07 Mar 2015 13:38
by sherington
I don't really do a lot on OSX, but one of the users of my bindings who does said that setting the VLC_PLUGIN_PATH environment variable to point to the plugins in the existing VLC installation does work.

So is it the case now with LibVLC on OSX that you are supposed to include/copy LibVLC and all of the plugins into your own application package, and that you can no longer just 'point' your application to the already installed VLC?

It has been said in this thread a number of times, and I agree with this, that this was *not* the case before 2.2.0, so I guess people are asking why this has changed, and if it was changed by design, or is it a bug.

Re: vlc 2.2.0 fails to create instance on Mac

Posted: 09 Mar 2015 12:37
by lanamelach
Ok, thanks sherington. I confirm that setting VLC_PLUGIN_PATH environment variable helps.

Now again the question to vlc developers. Why can I do without it on Windows? Why was not it required on Mac in older VLC versions? Is it made by design or we have just found the trick/workaround for the bug in vlc 2.2.0?