Ich habe ein Problem mit libVLC an dem ich jetzt schon stundenlang sitze. Und zwar versuche ich Informationen über eine mp3-Datei zu bekommen. Jedoch liefert mir die Funktion libvlc_media_get_tracks_info() keine Werte zurück. Hat jemand eine Idee woran das liegen könnte?
Hier der Code-Ausschnitt in dem die Threads (anscheinend erfolgreich) über Qt gesteuert werden:
Code: Alles auswählen
static void callback(const libvlc_event_t *event, void *data);
QWaitCondition condition;
bool t = true;
TrackInfo::TrackInfo(libvlc_media_t *const m)
{
cout << "TrackInfo" << endl;
m_mutex.lock();
cout << "create player" << endl;
m_player = libvlc_media_player_new_from_media(m);
cout << "add option" << endl;
//libvlc_media_add_option(m, "--sout=\"#description\""); funktioniert beides nicht...
libvlc_media_add_option(m, "sout=#description:dummy");
cout << "create event" << endl;
libvlc_event_manager_t *event = libvlc_media_player_event_manager(m_player);
cout << "attach event" << endl;
libvlc_event_attach(event, libvlc_MediaPlayerPlaying, &callback, NULL);
cout << "play" << endl;
libvlc_media_player_play(m_player);
cout << "before: " << t << endl;
condition.wait(&m_mutex);
cout << "after: " << t << endl;
libvlc_media_player_release(m_player);
cout << "get tracks info" << endl;
m_numinfo = libvlc_media_get_tracks_info(m, &m_trackinfo);
cout << "get duration" << endl;
m_duration = libvlc_media_get_duration(m);
m_durationstring = QTime(0, 0, 0, m_duration).toString("hh:mm:ss");
cout << "numinfo: " << m_numinfo << endl;
cout << "duration: " << m_duration << endl;
}
"t" ist nur eine Testvariable um zu prüfen, ob die Callback-Funktion zur richtigen Zeit aufgerufen wird, das scheint jedoch zu funktionieren.
Hier die Ausgabe nach der Initialisierung von libVLC mit "-vvv":
Code: Alles auswählen
[0x87a20f4] main libvlc debug: VLC media player - 1.1.4 The Luggage
[0x87a20f4] main libvlc debug: Copyright © 1996-2010 the VideoLAN team
[0x87a20f4] main libvlc debug: revision exported
[0x87a20f4] main libvlc debug: configured with ./configure '--enable-static' '--build=i686-linux-gnu' '--config-cache' '--disable-maintainer-mode' '--disable-silent-rules' '--disable-update-check' '--enable-fast-install' '--prefix=/usr' '--sysconfdir=/etc' '--with-binary-version=1ubuntu1.1' '--enable-a52' '--enable-aa' '--enable-bonjour' '--enable-caca' '--enable-dca' '--enable-dirac' '--enable-dvb' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-ggi' '--enable-gnutls' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libproxy' '--enable-libxml2' '--enable-lirc' '--enable-live555' '--enable-mad' '--enable-mkv' '--enable-mod' '--enable-mozilla' '--enable-mpc' '--enable-mtp' '--enable-mux_ogg' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-pulse' '--enable-qt4' '--enable-realrtsp' '--enable-schroedinger' '--enable-sdl' '--enable-shout' '--enable-skins2' '--enable-smb' '--enable-speex' '--enable-svg' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vcd' '--enable-vcdx' '--enable-vorbis' '--enable-x264' '--enable-zvbi' '--with-kde-solid=/usr/share/kde4/apps/' '--with-mozilla-pkg=libxul' '--disable-dxva2' '--disable-gnomevfs' '--disable-goom' '--disable-osso_screensaver' '--disable-portaudio' '--disable-projectm' '--disable-sqlite' '--disable-telx' '--enable-alsa' '--enable-atmo' '--enable-dc1394' '--enable-dv' '--enable-libva' '--enable-pvr' '--enable-udev' '--enable-v4l' '--enable-v4l2' '--enable-svgalib' 'build_alias=i686-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,--as-needed' 'CPPFLAGS=' 'CXXFLAGS=-g -O2'
[0x87a20f4] main libvlc debug: translation test: code is "C"
[0x87a20f4] main libvlc debug: checking plugin modules
[0x87a20f4] main libvlc debug: loading plugins cache file /usr/lib/vlc/plugins/plugins-04041e-7e8.dat
[0x87a20f4] main libvlc debug: recursively browsing `/usr/lib/vlc/plugins'
[0x87a20f4] main libvlc debug: saving plugins cache /usr/lib/vlc/plugins/plugins-04041e-7e8.dat
[0x87a20f4] main libvlc debug: module bank initialized (394 modules)
[0x87a20f4] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 FPU
[0x87a20f4] main libvlc debug: looking for memcpy module: 3 candidates
[0x87a20f4] main libvlc debug: using memcpy module "memcpymmxext"
[0x88486c4] main input debug: Creating an input for 'Media Library'
[0x88486c4] main input debug: Input is a meta file: disabling unneeded options
[0x88486c4] main input debug: using timeshift granularity of 50 MiB
[0x88486c4] main input debug: using timeshift path '/tmp'
[0x88486c4] main input debug: `file/xspf-open:///home/daniel/.local/share/vlc/ml.xspf' gives access `file' demux `xspf-open' path `/home/daniel/.local/share/vlc/ml.xspf'
[0x88486c4] main input debug: creating demux: access='file' demux='xspf-open' path='/home/daniel/.local/share/vlc/ml.xspf'
[0x883615c] main demux debug: looking for access_demux module: 2 candidates
[0x883615c] main demux debug: no access_demux module matching "file" could be loaded
[0x883615c] main demux debug: TIMER module_need() : 2.360 ms - Total 2.360 ms / 1 intvls (Avg 2.360 ms)
[0x88486c4] main input debug: creating access 'file' path='/home/daniel/.local/share/vlc/ml.xspf'
[0x883858c] main access debug: looking for access module: 2 candidates
[0x883858c] filesystem access debug: opening file `/home/daniel/.local/share/vlc/ml.xspf'
[0x883858c] main access debug: using access module "filesystem"
[0x883858c] main access debug: TIMER module_need() : 0.939 ms - Total 0.939 ms / 1 intvls (Avg 0.939 ms)
[0x88415c4] main stream debug: Using AStream*Stream
[0x88415c4] main stream debug: pre buffering
[0x88415c4] main stream debug: received first data after 0 ms
[0x88415c4] main stream debug: pre-buffering done 296 bytes in 0s - 4014 KiB/s
[0x8840c44] main stream debug: looking for stream_filter module: 5 candidates
[0x8840c44] main stream debug: no stream_filter module matching "any" could be loaded
[0x8840c44] main stream debug: TIMER module_need() : 1.547 ms - Total 1.547 ms / 1 intvls (Avg 1.547 ms)
[0x8840c44] main stream debug: looking for stream_filter module: 1 candidate
[0x8840c44] main stream debug: using stream_filter module "stream_filter_record"
[0x8840c44] main stream debug: TIMER module_need() : 0.470 ms - Total 0.470 ms / 1 intvls (Avg 0.470 ms)
[0x88486c4] main input debug: creating demux: access='file' demux='xspf-open' path='/home/daniel/.local/share/vlc/ml.xspf'
[0x8836e04] main demux debug: looking for demux module: 1 candidate
[0x8836e04] playlist demux debug: using XSPF playlist reader
[0x8836e04] main demux debug: using demux module "playlist"
[0x8836e04] main demux debug: TIMER module_need() : 0.764 ms - Total 0.764 ms / 1 intvls (Avg 0.764 ms)
[0x8841cfc] main demux meta debug: looking for meta reader module: 2 candidates
[0x8841cfc] lua demux meta debug: Trying Lua scripts in /home/daniel/.local/share/vlc/lua/meta/reader
[0x8841cfc] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x8841cfc] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x8841cfc] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x8841cfc] main demux meta debug: no meta reader module matching "any" could be loaded
[0x8841cfc] main demux meta debug: TIMER module_need() : 13.849 ms - Total 13.849 ms / 1 intvls (Avg 13.849 ms)
[0x88486c4] main input debug: `file/xspf-open:///home/daniel/.local/share/vlc/ml.xspf' successfully opened
[0x8841cfc] main xml debug: looking for xml module: 2 candidates
[0x8841cfc] main xml debug: using xml module "xml"
[0x8841cfc] main xml debug: TIMER module_need() : 1.675 ms - Total 1.675 ms / 1 intvls (Avg 1.675 ms)
[0x8836e04] playlist demux debug: parsed 0 tracks successfully
[0x8841cfc] main xml debug: removing module "xml"
[0x88486c4] main input debug: EOF reached
[0x8836e04] main demux debug: removing module "playlist"
[0x8840c44] main stream debug: removing module "stream_filter_record"
[0x883858c] main access debug: removing module "filesystem"
[0x88486c4] main input debug: TIMER input launching for 'Media Library' : 45.560 ms - Total 45.560 ms / 1 intvls (Avg 45.560 ms)
[0x88428e4] main interface debug: looking for interface module: 1 candidate
[0x88428e4] main interface debug: using interface module "hotkeys"
[0x88428e4] main interface debug: TIMER module_need() : 0.838 ms - Total 0.838 ms / 1 intvls (Avg 0.838 ms)
[0x8841cfc] main interface debug: looking for interface module: 1 candidate
[0x884734c] main playlist debug: Activated
[0x8841cfc] main interface debug: using interface module "inhibit"
[0x8841cfc] main interface debug: TIMER module_need() : 23.600 ms - Total 23.600 ms / 1 intvls (Avg 23.600 ms)
[0x884734c] main playlist debug: rebuilding array of current - root Playlist
[0x884734c] main playlist debug: rebuild done - 0 items, index -1
(6466) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-daniel/ksycoca4"
kfilemodule(6466)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/usr/share/mime/magic"
[0x8a33854] main input debug: Creating an input for '03-social_distortion-dont_take_me_for_granted.mp3'
TrackInfo
create player
add option
create event
attach event
play
before: 1
[0x8a32944] main input debug: Creating an input for 'Don't Take Me For Granted '
[0x8a32944] main input debug: thread (input) created at priority 10 (input/input.c:214)
[0x884734c] main playlist debug: no fetch required for Don't Take Me For Granted (art currently (null))
[0x8a32944] main input debug: thread started
[0x89c0d0c] main stream output debug: using sout chain=`description:dummy'
[0x89c0d0c] main stream output debug: stream=`dummy'
[0x8a27bbc] main stream out debug: looking for sout stream module: 1 candidate
[0x8a27bbc] main stream out debug: using sout stream module "stream_out_dummy"
[0x8a27bbc] main stream out debug: TIMER module_need() : 1.255 ms - Total 1.255 ms / 1 intvls (Avg 1.255 ms)
[0x89c0d0c] main stream output debug: stream=`description'
[0x89e8454] main stream out debug: looking for sout stream module: 1 candidate
[0x89e8454] main stream out debug: using sout stream module "stream_out_description"
[0x89e8454] main stream out debug: TIMER module_need() : 0.654 ms - Total 0.654 ms / 1 intvls (Avg 0.654 ms)
[0x8a32944] main input debug: using timeshift granularity of 50 MiB
[0x8a32944] main input debug: using timeshift path '/tmp'
[0x8a32944] main input debug: `/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3' gives access `' demux `' path `/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3'
[0x8a32944] main input debug: creating demux: access='' demux='' path='/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3'
[0x8a19924] main demux debug: looking for access_demux module: 9 candidates
[0x8aee614] main demux meta debug: looking for meta fetcher module: 1 candidate
[0x8aee614] lua demux meta debug: Trying Lua scripts in /home/daniel/.local/share/vlc/lua/meta/fetcher
[0x8aee614] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher
[0x8aee614] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
[0x8aee614] main demux meta debug: using meta fetcher module "lua"
[0x8aee614] main demux meta debug: TIMER module_need() : 2.166 ms - Total 2.166 ms / 1 intvls (Avg 2.166 ms)
[0x8aee614] main demux meta debug: removing module "lua"
[0x884734c] main playlist debug: found art for Don't Take Me For Granted in cache
[0x8a19924] main demux debug: no access_demux module matching "any" could be loaded
[0x8a19924] main demux debug: TIMER module_need() : 40.301 ms - Total 40.301 ms / 1 intvls (Avg 40.301 ms)
[0x8a32944] main input debug: creating access '' path='/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3'
[0x8a360e4] main access debug: looking for access module: 7 candidates
[0x8a360e4] vcd access debug: trying .cue file: /home/daniel/03-social_distortion-dont_take_me_for_granted.cue
[0x8a360e4] vcd access debug: could not find .cue file
[0x8a360e4] filesystem access debug: opening file `/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3'
[0x8a360e4] main access debug: using access module "filesystem"
[0x8a360e4] main access debug: TIMER module_need() : 19.883 ms - Total 19.883 ms / 1 intvls (Avg 19.883 ms)
[0x893cb04] main stream debug: Using AStream*Stream
[0x893cb04] main stream debug: pre buffering
[0x893cb04] main stream debug: received first data after 0 ms
[0x893cb04] main stream debug: pre-buffering done 1024 bytes in 0s - 29411 KiB/s
[0x89c4404] main stream debug: looking for stream_filter module: 5 candidates
[0x89c4404] main stream debug: no stream_filter module matching "any" could be loaded
[0x89c4404] main stream debug: TIMER module_need() : 0.202 ms - Total 0.202 ms / 1 intvls (Avg 0.202 ms)
[0x8be074c] main stream debug: looking for stream_filter module: 1 candidate
[0x8be074c] main stream debug: using stream_filter module "stream_filter_record"
[0x8be074c] main stream debug: TIMER module_need() : 0.135 ms - Total 0.135 ms / 1 intvls (Avg 0.135 ms)
[0x8a32944] main input debug: creating demux: access='' demux='' path='/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3'
[0x8aee804] main demux debug: ID3v2.3 revision 0 tag found, skipping 1720 bytes
[0x8aee804] main demux debug: looking for demux module: 52 candidates
[0x8aee804] es demux debug: detected format mpga
[0x8bd15ac] main demux packetizer debug: looking for packetizer module: 21 candidates
[0x8bd15ac] main demux packetizer debug: using packetizer module "mpeg_audio"
[0x8bd15ac] main demux packetizer debug: TIMER module_need() : 0.176 ms - Total 0.176 ms / 1 intvls (Avg 0.176 ms)
[0x8aee804] main demux debug: using demux module "es"
[0x8aee804] main demux debug: TIMER module_need() : 2.238 ms - Total 2.238 ms / 1 intvls (Avg 2.238 ms)
[0x8a32944] main input debug: starting in sync mode
[0x89fc5fc] main demux meta debug: looking for meta reader module: 2 candidates
[0x89fc5fc] main demux meta debug: using meta reader module "taglib"
[0x89fc5fc] main demux meta debug: TIMER module_need() : 0.666 ms - Total 0.666 ms / 1 intvls (Avg 0.666 ms)
[0x8aee804] main demux debug: removing module "taglib"
callback; received event: MediaPlayerPlaying
after: 0
get tracks info
get duration
numinfo: 0
duration: 0
[0x8a32944] main input debug: `/home/daniel/03-social_distortion-dont_take_me_for_granted.mp3' successfully opened
[0x8bd15ac] main demux packetizer debug: removing module "mpeg_audio"
[0x8aee804] main demux debug: removing module "es"
[0x8be074c] main stream debug: removing module "stream_filter_record"
[0x8a360e4] main access debug: removing module "filesystem"
[0x8a32944] main input debug: thread ended
[0x8a32944] main input debug: TIMER input launching for 'Don't Take Me For Granted ' : 99.349 ms - Total 99.349 ms / 1 intvls (Avg 99.349 ms)
[0x89e8454] main stream out debug: destroying chain... (name=description)
[0x89e8454] stream_out_description stream out debug: Closing
[0x89e8454] main stream out debug: removing module "stream_out_description"
[0x89e8454] main stream out debug: destroying chain done
[0x8a27bbc] main stream out debug: destroying chain... (name=dummy)
[0x8a27bbc] main stream out debug: removing module "stream_out_dummy"
[0x8a27bbc] main stream out debug: destroying chain done
Hat jemand Erfahrung damit?