Problem to load a M3U playlist

This forum is about all development around libVLC.
SaiyanRiku
Blank Cone
Blank Cone
Posts: 14
Joined: 08 Nov 2008 17:10
Location: Besançon, France

Problem to load a M3U playlist

Postby SaiyanRiku » 23 Dec 2008 18:09

Hi,

I have a problem with libvlc.
My program is based on the libVLC tutorial (http://wiki.videolan.org/LibVLC_Tutorial) with 0.9.x versions.

When I try to load a M3U playlist as a media, it doesn't work, for example :

Code: Select all

m = libvlc_media_new (inst, "http://viphttp.yacast.net/V4/radiofrance/franceinfo_bd.m3u", &ex);
But when I open it with VLC it works fine.

Any idea about the problem?

Thanks

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Problem to load a M3U playlist

Postby erwan10 » 23 Dec 2008 20:50

see this link http://mailman.videolan.org/pipermail/v ... 54167.html which answers a similar problem

SaiyanRiku
Blank Cone
Blank Cone
Posts: 14
Joined: 08 Nov 2008 17:10
Location: Besançon, France

Re: Problem to load a M3U playlist

Postby SaiyanRiku » 24 Dec 2008 14:35

Thanks, it works,
but in fact, it doesn't resolve my problem because in my program, I have a lot of URL's and I don't know if the media is a playlist or a simple video stream.
Do we have a medium to know the type of the media?

And I have another problem, the media subitem seems to be another problem, when I try :

Code: Select all

libvlc_media_list_player_play(mlp, &ex); raise (&ex); libvlc_media_list_t *ml2; ml2 = libvlc_media_subitems (m, &ex); raise (&ex); if(ml2 != NULL){ ... }
the sub media list is randomly created. I think it's due to the play fonction which start in a thread.
So, is a way exists to don't have this problem.

Thanks for all,

I hope my english is a little understandable...

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Problem to load a M3U playlist

Postby erwan10 » 24 Dec 2008 15:54

You're right . A media_player starts a new thread. Therefore, for a m3u file, the subitems are not available right away. Inserting a small sleep is an easy way to work out this problem. Another solution is to wait for the end of the media_player (using events and callbacks).

Also, if you use media_list, from what I recall, libvlc_media_list_add_file_content is blocking (no additional thread). So you are sure the subitems are available as soon as you exit this function.

As for knowing what a media is, m3u extension is definitively a playlist whether there is one or more items in it. And this process can be used recursively (embedded m3u files within m3u files work)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests