Page 1 of 1

libvlc_media_player_get_time() return -1

Posted: 05 May 2010 06:58
by jlz
Hello guis

Why libvlc_media_player_get_time() return -1 and a time after playing video return the correct value?

What must I do to sure a correct result? Wait some event? some example code, please?

Thanks.

Re: libvlc_media_player_get_time() return -1

Posted: 05 May 2010 08:51
by henrymark
Does it is normal ?? When playing you will get correct time, otherwise you will get -1.

Re: libvlc_media_player_get_time() return -1

Posted: 05 May 2010 11:32
by jlz
ohh,I'm sorry.

The copy-paste spent me a joke :( .

I wanted to say libvlc_media_get_duration(), not get_time()

Yes, libvlc_media_player_get_time() return -1 correctly before play but I think libvlc_media_get_duration() usually should return correct value after
a call to libvlc_media_new ();


is it posible that missing functions

VLC_PUBLIC_API void libvlc_media_parse (libvlc_media_t *media)
Parse a media.
VLC_PUBLIC_API void libvlc_media_parse_async (libvlc_media_t *media)
Parse a media.
VLC_PUBLIC_API int libvlc_media_is_parsed (libvlc_media_t *p_md)
Get Parsed status for media descriptor object.

may be something to do with it ?

Actually I link with 1.0.6 version.

Thanks in avance

Re: libvlc_media_player_get_time() return -1

Posted: 05 May 2010 18:50
by RĂ©mi Denis-Courmont
The duration is only known once the media has been opened, and the necessary informations obtained (in-band). In some case, it is not available at all.

The libvlc_media_*parse* functions are available in Libvlc 1.1. You may be reading documentation for the wrong version.

Re: libvlc_media_player_get_time() return -1

Posted: 06 May 2010 06:52
by jlz
Yes. It's posible.

I get "SDK" from http://download.videolan.org/pub/videol ... -win32.zip. It was the last version when I began. I read the documentatiom fromhttp://www.videolan.org/developers/vlc/ ... index.html. It say version 1.0.0.git so, I supose that was older than 1.0.5 but similar API.

The http://www.videolan.org/developers/vlc/ ... media.html page tell about

Code: Select all

VLC_PUBLIC_API void libvlc_media_parse (libvlc_media_t *media)
fuction but it is not on includes.

What would be the best strategy to be synchronized?

Thanks

Re: libvlc_media_player_get_time() return -1

Posted: 08 May 2010 19:23
by Jean-Baptiste Kempf
The API is about 1.1.0