[vlc-devel] RE : How to continue playing an online playlist with LibVLC?

brezhoneg1 brezhoneg1 at yahoo.fr
Fri Feb 20 19:32:35 CET 2009


Hi,

   When using a media/media_player in libvlc, playlists (asx, m3u, xspf,
dir, ...) are only parsed and never launched automatically.

   Once the parsing is done, a media_list made up of all the items found
in the playlist is available at the media level. It's up to you to
decide what to do with it.

Erwan10   

-----Message d'origine-----
De : vlc-devel-bounces at videolan.org
[mailto:vlc-devel-bounces at videolan.org] De la part de Stream Alerts
Envoyé : vendredi 20 février 2009 17:53
À : vlc-devel at videolan.org
Objet : [vlc-devel] How to continue playing an online playlist with
LibVLC?

Hello!
I'm having trouble figuring out how to make a LibVLC player play through
a playlist found online. The player grabs the playlist and is able to
parse it (in this case a Windows Media .ASX file) but after it finishes
parsing, it just returns libvlc_MediaPlayerEndReached and does not
actually play the streams in the list. If I open the same URL in VLC
proper, it plays without any problems. Below is the debug output and the
code and options I'm using. Thank you in advanced for any help ya'll can
give me!
Sincerely,
Chris Larsen

DEBUG:

[00000001] main libvlc debug: VLC media player - version 0.9.8a
Grishenko - (c)
1996-2008 the VideoLAN team
[00000001] main libvlc debug: libvlc was configured with ./configure 
'--host=i5
86-mingw32msvc' '--build=i386-linux' '--enable-mkv' '--enable-release'
'--withou
t-contrib' '--enable-nls' '--enable-shared-libvlc'
'--enable-update-check' '--en
able-lua' '--enable-faad' '--enable-flac' '--enable-theora'
'--enable-twolame' '
--enable-quicktime' '--enable-real' '--enable-realrtsp'
'--enable-ffmpeg' '--wit
h-ffmpeg-mp3lame' '--with-ffmpeg-faac'
'--with-ffmpeg-config-path=/usr/win32/bin
' '--with-ffmpeg-zlib' '--enable-live555'
'--with-live555-tree=/usr/win32/live.c
om' '--ena
[00000001] main libvlc debug: translation test: code is "C"
[00000001] main libvlc debug: checking builtin modules
[00000001] main libvlc debug: checking plugin modules
[00000001] main libvlc debug: recursively browsing
`c:\VLC\vlc_tester\Debug\modules'
[00000001] main libvlc debug: recursively browsing
`c:\VLC\vlc_tester\Debug\plugins'
[00000001] main libvlc debug: recursively browsing `C:\VLC\plugins'
[00000001] main libvlc debug: module bank initialized, found 264 modules
[00000001] main libvlc debug: CPU has capabilities 486 586 MMX MMXEXT
SSE SSE2 F
PU
[00000001] main libvlc debug: looking for memcpy module: 3 candidates
[00000001] main libvlc debug: using memcpy module "memcpymmxext"
[00000360] main interaction debug: thread 4964 (Interaction control)
created at
priority 0 (interface/interaction.c:382)
[00000360] main interaction debug: thread started
[00000362] main input debug: Creating an input for 'Media Library'
[00000362] main input debug: Input is a meta file: disabling unneeded
options
[00000362] main input debug:
`file/xspf-open://C:\Users\~\AppData\Roaming\v
lc\ml.xspf' gives access `file' demux `xspf-open' path
`C:\Users\~\AppData\
Roaming\vlc\ml.xspf'
[00000362] main input debug: creating access 'file'
path='C:\Users\~\AppDat
a\Roaming\vlc\ml.xspf'
[00000363] main access debug: looking for access module: 2 candidates
[00000363] access_file access debug: opening file
`C:\Users\~\AppData\Roami
ng\vlc\ml.xspf'
[00000363] main access debug: using access module "access_file"
[00000363] main access debug: TIMER module_Need() : 2.000 ms - Total
2.000 ms /
1 intvls (Avg 2.000 ms)
[00000364] main stream debug: Using AStream*Stream
[00000364] main stream debug: pre-buffering...
[00000364] main stream debug: received first data for our buffer
[00000362] main input debug: creating demux: access='file'
demux='xspf-open' pat
h='C:\Users\~\AppData\Roaming\vlc\ml.xspf'
[00000365] main demux debug: looking for demux module: 1 candidate
[00000365] playlist demux debug: using XSPF playlist reader
[00000365] main demux debug: using demux module "playlist"
[00000365] main demux debug: TIMER module_Need() : 2.000 ms - Total
2.000 ms / 1
 intvls (Avg 2.000 ms)
[00000362] main input debug:
`file/xspf-open://C:\Users\~\AppData\Roaming\v
lc\ml.xspf' successfully opened
[00000366] main xml debug: looking for xml module: 2 candidates
[00000366] main xml debug: using xml module "xml"
[00000366] main xml debug: TIMER module_Need() : 1.000 ms - Total 1.000
ms / 1 i
ntvls (Avg 1.000 ms)
[00000365] playlist demux debug: parsed 0 tracks successfully
[00000366] main xml debug: removing module "xml"
[00000362] main input debug: EOF reached
[00000362] main input debug: control type=1
[00000365] main demux debug: removing module "playlist"
[00000363] main access debug: removing module "access_file"
[00000362] main input debug: TIMER input launching for 'Media Library' :
21.000
ms - Total 21.000 ms / 1 intvls (Avg 21.000 ms)
[00000367] main preparser debug: waiting for thread initialization
[00000367] main preparser debug: thread started
[00000367] main preparser debug: thread 5044 (preparser) created at
priority 0 (
playlist/thread.c:79)
[00000368] main fetcher debug: waiting for thread initialization
[00000368] main fetcher debug: thread started
[00000368] main fetcher debug: thread 5056 (fetcher) created at priority
0 (play
list/thread.c:108)
[00000361] main playlist debug: waiting for thread initialization
[00000361] main playlist debug: thread started
[00000361] main playlist debug: rebuilding array of current - root
Playlist
[00000361] main playlist debug: rebuild done - 0 items, index -1
[00000361] main playlist debug: thread 5052 (playlist) created at
priority 0 (pl
aylist/thread.c:117)
[00000369] main interface debug: looking for interface module: 1
candidate
[00000369] main interface debug: using interface module "hotkeys"
[00000369] main interface debug: TIMER module_Need() : 1.000 ms - Total
1.000 ms
 / 1 intvls (Avg 1.000 ms)
[00000369] main interface debug: thread 5076 (interface) created at
priority 0 (
interface/interface.c:168)
[00000369] main interface debug: thread started
[00000361] main playlist debug: adding item `' (  )
[00000361] main playlist debug: adding item `' (  )
[00000361] main playlist debug: adding item `' (  )
----- try to play....
[00000370] main input debug: Creating an input for
'http://www.beethoven.com/bee
thoven_ad.asx'
[00000370] main input debug: waiting for thread initialization
[00000370] main input debug: thread started
[00000370] main input debug: `http://www.beethoven.com/beethoven_ad.asx'
gives a
ccess `http' demux `' path `www.beethoven.com/beethoven_ad.asx'
[00000370] main input debug: thread 5188 (input) created at priority 1
(input/in
put.c:370)
[00000370] main input debug: creating demux: access='http' demux=''
path='www.be
ethoven.com/beethoven_ad.asx'
[00000371] main demux debug: looking for access_demux module: 0
candidates
[00000361] main playlist debug: no fetch required for
http://www.beethoven.com/b
eethoven_ad.asx (art currently (null))
State: 0
[00000371] main demux warning: no access_demux module matched "http"
[00000371] main demux debug: TIMER module_Need() : 2.000 ms - Total
2.000 ms / 1
 intvls (Avg 2.000 ms)
[00000370] main input debug: creating access 'http'
path='www.beethoven.com/beet
hoven_ad.asx'
[00000372] main access debug: looking for access module: 2 candidates
[00000372] access_http access debug: http: server='www.beethoven.com'
port=80 fi
le='/beethoven_ad.asx
[00000372] main access debug: net: connecting to www.beethoven.com port
80
[00000372] main access debug: connection: Resource temporarily
unavailable
[00000372] main access debug: connection succeeded (socket = 5360)
[00000372] access_http access debug: protocol 'HTTP' answer code 206
[00000372] access_http access debug: this frame size=1482
[00000372] access_http access debug: Content-Type: video/x-ms-asf
[00000372] access_http access debug: stream
size=1482,pos=0,remaining=1482
[00000372] access_http access debug: Server: Microsoft-IIS/6.0
[00000372] access_http access debug: We have a Cookie we won't remember:
Coyote-
2-ac10036f=ac10030a:0; path=/
[00000372] main access debug: using access module "access_http"
[00000372] main access debug: TIMER module_Need() : 200.000 ms - Total
200.000 m
s / 1 intvls (Avg 200.000 ms)
[00000373] main stream debug: Using AStream*Stream
[00000373] main stream debug: pre-buffering...
[00000373] main stream debug: received first data for our buffer
[00000370] main input debug: creating demux: access='http' demux=''
path='www.be
ethoven.com/beethoven_ad.asx'
[00000374] main demux debug: looking for demux module: 51 candidates
[00000374] playlist demux debug: found valid ASX playlist
[00000374] main demux debug: using demux module "playlist"
[00000374] main demux debug: TIMER module_Need() : 1.000 ms - Total
1.000 ms / 1
 intvls (Avg 1.000 ms)
[00000370] main input debug: `http://www.beethoven.com/beethoven_ad.asx'
success
fully opened
@@@@@@@@@@@@@ Caught event: libvlc_MediaPlayerPlaying
[00000374] playlist demux debug: param name strlen: 8
[00000374] playlist demux debug: param name: HTMLView
[00000374] playlist demux debug: param name strlen: 8
[00000374] playlist demux debug: param name: HTMLView
[00000374] playlist demux debug: param name strlen: 8
[00000374] playlist demux debug: param name: HTMLView
[00000370] main input debug: EOF reached
[00000370] main input debug: control type=1
@@@@@@@@@@@@@ Caught event: libvlc_MediaPlayerEndReached

OPTIONS:
-I dummy
--vout dummy
--aout dummy
--no-plugins-cache
--verbose=2
--no-video-title-show
--ignore-config
--no-sub-autodetect

CODE:
libvlc_exception_init (&ex);
inst = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args,
&ex);
m = libvlc_media_new (inst, url.c_str(), &ex);
mp = libvlc_media_player_new_from_media (m, &ex);
libvlc_event_manager_t *em;
em = libvlc_media_player_event_manager( mp, &ex );
libvlc_event_attach( em, libvlc_MediaPlayerPlaying, Media_State_Changed,
NULL, &ex );
libvlc_event_attach( em, libvlc_MediaPlayerEndReached,
Media_State_Changed, NULL, &ex );
libvlc_media_player_play (mp, &ex);
Sleep(INFINITE);





More information about the vlc-devel mailing list