libvlc_media_player_get_position and playlist

This forum is about all development around libVLC.
VlC_Freak
New Cone
New Cone
Posts: 8
Joined: 22 Mar 2011 13:59

libvlc_media_player_get_position and playlist

Postby VlC_Freak » 22 Mar 2011 14:10

Hi all
im using a delphi warpper for libVLC (http://sourceforge.net/projects/paslibvlc/) and i'm trying to using playlist stuff of Libvlc

p_li := libvlc_new(1, @args);

// create player instance
p_mi := libvlc_media_player_new(p_li);

// create a playList object
p_ml := libvlc_media_list_new(p_li);

// create a player of playlist
p_mlp := libvlc_media_list_player_new(p_li);

// set the playlistplayer with the playlist
libvlc_media_list_player_set_media_list(p_mlp, p_ml);


the trouble i have is when im using libvlc_media_player_get_position for get the position of the current beat playing i get -1

i try first with this
libvlc_media_player_get_position(p_mi) Result -1
and
libvlc_media_player_get_position(p_mlp) Result -1

But without succes, could someone tell me what i'm making wrong

Thanks for any tips or help
Christian

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc_media_player_get_position and playlist

Postby sherington » 22 Mar 2011 14:50

I think you need to associate your media player with your media list player.

Code: Select all

libvlc_media_list_player_set_media_player(p_mlp, p_mi);
Then you can invoke libvlc_media_player_get_position(p_mi).
Last edited by sherington on 22 Mar 2011 15:05, edited 1 time in total.

VlC_Freak
New Cone
New Cone
Posts: 8
Joined: 22 Mar 2011 13:59

Re: libvlc_media_player_get_position and playlist

Postby VlC_Freak » 22 Mar 2011 15:04

thanks it working

but all function that use libvlc_media_list_player_get_state(p_mlp) return me -1 after set this
libvlc_media_list_player_set_media_player(m_mlp, m_mi);

i need to know all this state of vlc

libvlc_NothingSpecial
libvlc_Opening
libvlc_Buffering
libvlc_Playing
libvlc_Paused
libvlc_Stopped
libvlc_Ended
libvlc_Error

Thanks again !!!

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc_media_player_get_position and playlist

Postby sherington » 22 Mar 2011 15:08

thanks it working
but all function that use libvlc_media_list_player_get_state(p_mlp) return me -1 after set this
libvlc_media_list_player_set_media_player(m_mlp, m_mi);
Obviously:

Code: Select all

int libvlc_media_player_get_state(libvlc_media_player_t p_mi);
But you should probably be using events.

VlC_Freak
New Cone
New Cone
Posts: 8
Joined: 22 Mar 2011 13:59

Re: libvlc_media_player_get_position and playlist

Postby VlC_Freak » 22 Mar 2011 15:21

Hi man

i got it, it look like that when i set this

libvlc_media_list_player_set_media_player(p_mlp, p_mi);
The state of the player is null so i need to make this small tweak for setup stop state

libvlc_media_list_lock(p_ml);
libvlc_media_list_player_stop(p_mlp);
libvlc_media_list_unlock(p_ml);

thanks again for the fast help


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests