+ PL_UNLOCK_IF( !b_locked );
+ return NULL;
+}
+
+/**
+ * Get input by item id
+ *
+ * Find the playlist item matching the input id under the given node
+ * \param p_playlist the playlist
+ * \param i_input_id the id of the input to find
+ * \param p_root the root node of the search
+ * \return the playlist item or NULL on failure
+ */
+playlist_item_t * playlist_ItemGetByInputId( playlist_t *p_playlist,
+ int i_input_id,
+ playlist_item_t *p_root )
+{
+ int i;
+ PL_ASSERT_LOCKED;
+ assert( p_root != NULL );
+ for( i = 0 ; i< p_root->i_children ; i++ )
+ {
+ if( p_root->pp_children[i]->p_input &&
+ p_root->pp_children[i]->p_input->i_id == i_input_id )
+ {
+ return p_root->pp_children[i];
+ }
+ else if( p_root->pp_children[i]->i_children >= 0 )
+ {
+ return playlist_ItemGetByInputId( p_playlist, i_input_id,
+ p_root->pp_children[i] );
+ }
+ }