[vlc-commits] In libvlc_media_list_player_play_item_at_index() set the media descriptor on the NextItemSet event.

Mark Lee git at videolan.org
Fri May 11 21:05:52 CEST 2012


vlc/vlc-2.0 | branch: master | Mark Lee <mark.lee at capricasoftware.co.uk> | Wed May  9 17:29:34 2012 +0100| [fc6f188aef93d2562aefb26b266cf99407bb4edd] | committer: Jean-Baptiste Kempf

In libvlc_media_list_player_play_item_at_index() set the media descriptor on the NextItemSet event.

This is now the same as was already implemented in the
set_relative_playlist_position_and_play() method.
(cherry picked from commit c64c794ee123b8a7d57682db6b753bf1dadec54f)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=fc6f188aef93d2562aefb26b266cf99407bb4edd
---

 lib/media_list_player.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lib/media_list_player.c b/lib/media_list_player.c
index 7522e5e..9af6578 100644
--- a/lib/media_list_player.c
+++ b/lib/media_list_player.c
@@ -646,14 +646,18 @@ libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp)
 int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp, int i_index)
 {
     lock(p_mlp);
-    set_current_playing_item(p_mlp, libvlc_media_list_path_with_root_index(i_index));
+    libvlc_media_list_path_t path = libvlc_media_list_path_with_root_index(i_index);
+    set_current_playing_item(p_mlp, path);
     libvlc_media_player_play(p_mlp->p_mi);
     unlock(p_mlp);
 
     /* Send the next item event */
     libvlc_event_t event;
     event.type = libvlc_MediaListPlayerNextItemSet;
+    libvlc_media_t * p_md = libvlc_media_list_item_at_path(p_mlp->p_mlist, path);
+    event.u.media_list_player_next_item_set.item = p_md;
     libvlc_event_send(p_mlp->p_event_manager, &event);
+    libvlc_media_release(p_md);
     return 0;
 }
 



More information about the vlc-commits mailing list