[vlc-devel] length of video with libvlc 0.8.6c

Nicolae Paladi n.paladi at gmail.com
Wed Dec 10 13:57:46 CET 2008


I have two related questions:

1 .Is there a way to find out the length of the video in libvlc 0.8.6c?

The libvlc external API states that

*mtime_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception ) 
// Length in ms --

but libvlc_input_t* obtained from **libvlc_input_t * 
libvlc_playlist_get_input( libvlc_instance *, libvlc_exception ) is 
null, even if the playlist is not empty;

2. The exaples of use of VLC state that sleep should be used to wait for 
the video to play

(as in the following chunk:

 libvlc_playlist_play (inst, item, 0, NULL, &excp); 
   quit_on_exception (&excp);
   usleep (10000000);
   libvlc_destroy (inst);
   return 0;


this is from http://wiki.videolan.org/LibVLC_Tutorial_086c

How can the sleep statement be avoided?


More information about the vlc-devel mailing list