How do I get current input thread as soon as it is created?

This forum is about all development around libVLC.
Vaselinessa
Blank Cone
Blank Cone
Posts: 48
Joined: 03 Apr 2011 02:26
Location: Sacramento, CA

How do I get current input thread as soon as it is created?

Postby Vaselinessa » 12 Jan 2013 23:37

In version 2.1, I am trying to get the current input thread as soon as it is created, but the program freezes when I try.

I attached a callback to the playlist's "item-change" event, then call playlist_CurrentInput in the callback. I see that I am wrong, but what am I supposed to do? (In 2.0.X, I attached a callback to "item-current", but vlc_playlist.h appears not to use that as an event variable anymore.)

Code: Select all

void init(...) { p_playlist = pl_Get(p_intf); var_AddCallback( p_playlist, "item-change", PlaylistCbItemChange, NULL ); } int PlaylistCbItemChange( vlc_object_t *p_this, const char *psz_var, vlc_value_t oldval, vlc_value_t newval, void *p_data ) { msg_Info( p_this, "input item changed [1] " ); input_thread_t * p = playlist_CurrentInput( p_playlist ); msg_Info( p_this, "input item changed [2] " ); }
Thank you for your time.

Vaselinessa
Blank Cone
Blank Cone
Posts: 48
Joined: 03 Apr 2011 02:26
Location: Sacramento, CA

Re: How do I get current input thread as soon as it is creat

Postby Vaselinessa » 13 Jan 2013 01:06

I think I've solved this one. If I run playlist_CurrentInput in another thread, it seems to work fine.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests