Hello Rémi,<br><br>The p_md reference is obtained by this new line of code (I put this inside the play-list lock earlier in the same method):<br><br>+    libvlc_media_t* p_md = libvlc_media_list_item_at_path(p_mlp->p_mlist, path);<br>
<br>To answer your question, no, there was no leak before.<br><br>I think p_md probably can not be NULL in this code but I added some defensive code anyway.<br><br>My Java bindings depend on this media descriptor being set properly on the event, and this patch fixes that issue for me.<br>
<br>I'm not sure my email client is configured properly for git email so apologies if this creates a new disconnected thread.<br><br>Regards,<br><br>-M.<br><br><div class="gmail_quote">On 7 May 2012 20:45, Mark Lee <span dir="ltr"><<a href="mailto:mark.lee@capricasoftware.co.uk" target="_blank">mark.lee@capricasoftware.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 lib/media_list_player.c |    9 ++++++++-<br>
 1 file changed, 8 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/lib/media_list_player.c b/lib/media_list_player.c<br>
index 7522e5e..09109c7 100644<br>
--- a/lib/media_list_player.c<br>
+++ b/lib/media_list_player.c<br>
@@ -646,14 +646,21 @@ libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp)<br>
 int libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_mlp, int i_index)<br>
 {<br>
     lock(p_mlp);<br>
-    set_current_playing_item(p_mlp, libvlc_media_list_path_with_root_index(i_index));<br>
+    libvlc_media_list_path_t path = libvlc_media_list_path_with_root_index(i_index);<br>
+    set_current_playing_item(p_mlp, path);<br>
     libvlc_media_player_play(p_mlp->p_mi);<br>
+    libvlc_media_t* p_md = libvlc_media_list_item_at_path(p_mlp->p_mlist, path);<br>
     unlock(p_mlp);<br>
<br>
     /* Send the next item event */<br>
     libvlc_event_t event;<br>
     event.type = libvlc_MediaListPlayerNextItemSet;<br>
+    event.u.media_list_player_next_item_set.item = p_md;<br>
     libvlc_event_send(p_mlp->p_event_manager, &event);<br>
+<br>
+    if (p_md)<br>
+        libvlc_media_release(p_md);<br>
+<br>
     return 0;<br>
 }<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br>