libvlc_media_player_get_time() return -1

This forum is about all development around libVLC.
jlz
Blank Cone
Blank Cone
Posts: 11
Joined: 13 Jul 2009 12:09

libvlc_media_player_get_time() return -1

Postby jlz » 05 May 2010 06:58

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.

henrymark
Blank Cone
Blank Cone
Posts: 46
Joined: 11 Aug 2009 09:55

Re: libvlc_media_player_get_time() return -1

Postby henrymark » 05 May 2010 08:51

Does it is normal ?? When playing you will get correct time, otherwise you will get -1.

jlz
Blank Cone
Blank Cone
Posts: 11
Joined: 13 Jul 2009 12:09

Re: libvlc_media_player_get_time() return -1

Postby jlz » 05 May 2010 11:32

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

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

Re: libvlc_media_player_get_time() return -1

Postby Rémi Denis-Courmont » 05 May 2010 18:50

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jlz
Blank Cone
Blank Cone
Posts: 11
Joined: 13 Jul 2009 12:09

Re: libvlc_media_player_get_time() return -1

Postby jlz » 06 May 2010 06:52

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libvlc_media_player_get_time() return -1

Postby Jean-Baptiste Kempf » 08 May 2010 19:23

The API is about 1.1.0
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests