vlc 2.2.0 fails to create instance on Mac

This forum is about all development around libVLC.
lanamelach
Blank Cone
Blank Cone
Posts: 31
Joined: 18 Nov 2010 13:22

vlc 2.2.0 fails to create instance on Mac

Postby lanamelach » 03 Mar 2015 15:10

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.
No milk today

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: vlc 2.2.0 fails to create instance on Mac

Postby Jean-Baptiste Kempf » 04 Mar 2015 10:24

Your plugins are not packaged, I guess.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

lanamelach
Blank Cone
Blank Cone
Posts: 31
Joined: 18 Nov 2010 13:22

Re: vlc 2.2.0 fails to create instance on Mac

Postby lanamelach » 04 Mar 2015 11:06

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.
No milk today

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: vlc 2.2.0 fails to create instance on Mac

Postby Jean-Baptiste Kempf » 04 Mar 2015 23:30

Your plugins are not in the application .app package like in VLC.app
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

lanamelach
Blank Cone
Blank Cone
Posts: 31
Joined: 18 Nov 2010 13:22

Re: vlc 2.2.0 fails to create instance on Mac

Postby lanamelach » 05 Mar 2015 07:21

Ok, what plugins should I place and where? Why wasn't it needed for previous vlc versions?
No milk today

klaas2
Blank Cone
Blank Cone
Posts: 11
Joined: 11 Oct 2010 09:04

Re: vlc 2.2.0 fails to create instance on Mac

Postby klaas2 » 05 Mar 2015 10:40

Dear Jean, perhaps you can give one more hint? As I seem to have the same issue....

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: vlc 2.2.0 fails to create instance on Mac

Postby RSATom » 05 Mar 2015 15:38

What else libvlc related files except libvlc.dylib did you place to your .app package?

lanamelach
Blank Cone
Blank Cone
Posts: 31
Joined: 18 Nov 2010 13:22

Re: vlc 2.2.0 fails to create instance on Mac

Postby lanamelach » 05 Mar 2015 15:56

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.
No milk today

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: vlc 2.2.0 fails to create instance on Mac

Postby sherington » 07 Mar 2015 13:38

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.

lanamelach
Blank Cone
Blank Cone
Posts: 31
Joined: 18 Nov 2010 13:22

Re: vlc 2.2.0 fails to create instance on Mac

Postby lanamelach » 09 Mar 2015 12:37

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?
No milk today


Return to “Development around libVLC”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests