Page 1 of 1

Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Posted: 20 May 2013 21:45
by stefan.grotehans
Hello,
I am porting from linux to Mac OSX (10.8.X) a C program which uses the libvlc.

Using the 2.0.6 version the parsing of an URL works.
However, using the 2.1.0-pre library (nightly build from 19.5) the URL gets misinterpreted and the File Path where I started the program is being prefixed:

In 2.0.6: http://mycool.movie.com/test.movi is correctly opened
In 2.1.0-pre1 the error is: cannot open file /Users/sgr/devel/example/http://mycool.movie.com/test.movi
(I started the program in the directory: /Users/sgr/devel/example/)
The error happens in this function call.
m = libvlc_media_new_path (inst, "http://mycool.movie.com/test.movi");

I compiled the program with:
gcc example.c -I/Applications/VLC.app/Contents/MacOS/include/ -L/Applications/VLC.app/Contents/MacOS/lib/ -lvlc -o example

I run it with:
export DYLD_LIBRARY_PATH=/Applications/VLC.app/Contents/MacOS/lib/
./example

Perhaps this is a bug in the Pre1 Version of libvlc?

Stefan

Here is the small program example.c:

Code: Select all

#include <stdio.h> #include <stdlib.h> #include <vlc/vlc.h> int main(int argc, char* argv[]) { libvlc_instance_t * inst; libvlc_media_player_t *mp; libvlc_media_t *m; /* Load the VLC engine */ inst = libvlc_new (0, NULL); /* Create a new item */ m = libvlc_media_new_path (inst, "http://mycool.movie.com/test.movi"); /* Create a media player playing environement */ mp = libvlc_media_player_new_from_media (m); /* No need to keep the media now */ libvlc_media_release (m); #if 0 /* This is a non working code that show how to hooks into a window, * if we have a window around */ libvlc_media_player_set_xdrawable (mp, xdrawable); /* or on windows */ libvlc_media_player_set_hwnd (mp, hwnd); /* or on mac os */ libvlc_media_player_set_nsobject (mp, view); #endif /* play the media_player */ libvlc_media_player_play (mp); sleep (10); /* Let it play a bit */ /* Stop playing */ libvlc_media_player_stop (mp); /* Free the media_player */ libvlc_media_player_release (mp); libvlc_release (inst); return 0; }

Re: Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Posted: 20 May 2013 21:49
by mangokm40
Isn't "libvlc_media_new_location" the one that opens an MRL?

Re: Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Posted: 23 May 2013 15:09
by stefan.grotehans
Hi,
The problem is that parsing an MRL to libvlc belonging to 2.0.6 it works but not in the current nightly builds.

Using the nightly builds the "http://" prefix is treated as a file name and the absolute path to the "http://" file is prefixed.

I think this is a bug in the libvlc implementation for Mac OSX.

Stefan

Re: Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Posted: 23 May 2013 17:17
by RĂ©mi Denis-Courmont
That's a bug in your code as mangokm40 said.

Re: Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Posted: 01 Jun 2013 06:12
by geostein8888
when i read this i ask me if you do not have a problem with a crash while putting the video onto the videoscreen. If not it would be nice when you can share the information how you manage the display in your source

Georg

Re: Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Posted: 05 Jun 2013 10:28
by stefan.grotehans
Thanks for clarification,
I used an old example, I had simply to replace "path" with "location" for the 2.1 related version of liblvc.
I run into this problem compiling EasyStream for the vdr software. It is based on Qt and runs on Windows/Linux.
Now with Qt5 libvlc_media_player_set_nsobject works and does not crash as in Qt 4.8.
Hope that helps.
stefan