]> git.sesse.net Git - vlc/commitdiff
In libvlc_media_list_player_play_item_at_index() set the media descriptor on the...
authorMark Lee <mark.lee@capricasoftware.co.uk>
Wed, 9 May 2012 16:29:34 +0000 (17:29 +0100)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 11 May 2012 14:51:29 +0000 (17:51 +0300)
This is now the same as was already implemented in the
set_relative_playlist_position_and_play() method.

lib/media_list_player.c

index 7522e5e675cfc945a54b841452f0e0b4756e487d..9af65783b9b6a12cf76465ec253b6fd23cdfba92 100644 (file)
@@ -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;
 }