Page 1 of 1

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

Posted: 12 Jan 2013 23:37
by Vaselinessa
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.

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

Posted: 13 Jan 2013 01:06
by Vaselinessa
I think I've solved this one. If I run playlist_CurrentInput in another thread, it seems to work fine.