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;
}