+//#define DEBUG_MEDIA_LIST_PLAYER
+
+/* This is a very dummy implementation of playlist on top of
+ * media_list and media_player.
+ *
+ * All this code is doing is simply computing the next item
+ * of a tree of media_list (see get_next_index()), and play
+ * the next item when the current is over. This is happening
+ * via the event callback media_player_reached_end().
+ *
+ * This is thread safe, and we use a two keys (locks) scheme
+ * to discriminate between callbacks and regular uses.
+ */
+
+struct libvlc_media_list_player_t
+{
+ libvlc_event_manager_t * p_event_manager;
+ libvlc_instance_t * p_libvlc_instance;
+ int i_refcount;
+ /* Protect access to this structure. */
+ vlc_mutex_t object_lock;
+ /* Protect access to this structure and from callback execution. */
+ vlc_mutex_t mp_callback_lock;
+ /* Indicate to media player callbacks that they are cancelled. */
+ bool are_mp_callback_cancelled;
+ libvlc_media_list_path_t current_playing_item_path;
+ libvlc_media_t * p_current_playing_item;
+ libvlc_media_list_t * p_mlist;
+ libvlc_media_player_t * p_mi;
+ libvlc_playback_mode_t e_playback_mode;
+};
+
+/* This is not yet exported by libvlccore */
+static inline void vlc_assert_locked(vlc_mutex_t *mutex)
+{
+ VLC_UNUSED(mutex);
+}
+
+/*
+ * Forward declaration
+ */
+
+static
+int set_relative_playlist_position_and_play(libvlc_media_list_player_t *p_mlp,
+ int i_relative_position);
+static void stop(libvlc_media_list_player_t * p_mlp);
+