Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

This forum is about all development around libVLC.
stefan.grotehans
New Cone
New Cone
Posts: 3
Joined: 20 May 2013 21:14

Parsing Problem with libvlc 2.1.0-pre1 on Mac OSX 10.8

Postby stefan.grotehans » 20 May 2013 21:45

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

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

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

Postby mangokm40 » 20 May 2013 21:49

Isn't "libvlc_media_new_location" the one that opens an MRL?

stefan.grotehans
New Cone
New Cone
Posts: 3
Joined: 20 May 2013 21:14

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

Postby stefan.grotehans » 23 May 2013 15:09

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15228
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 23 May 2013 17:17

That's a bug in your code as mangokm40 said.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

geostein8888
Cone that earned his stripes
Cone that earned his stripes
Posts: 142
Joined: 15 Dec 2010 11:32

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

Postby geostein8888 » 01 Jun 2013 06:12

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

stefan.grotehans
New Cone
New Cone
Posts: 3
Joined: 20 May 2013 21:14

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

Postby stefan.grotehans » 05 Jun 2013 10:28

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 29 guests