[vlc-devel] [PATCH] Support of the defined but unused "libvlc_MediaListPlayerPlayed" event Event fires when libvlc_media_list_player is played last item in the playlist

Igor Prokopenkov cmyk777 at gmail.com
Fri Oct 3 18:25:24 CEST 2014


Signed-off-by: Igor Prokopenkov <cmyk777 at gmail.com>
---
 lib/media_list_player.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/media_list_player.c b/lib/media_list_player.c
index d0a0ce1..9ac935a 100644
--- a/lib/media_list_player.c
+++ b/lib/media_list_player.c
@@ -474,6 +474,8 @@ libvlc_media_list_player_new(libvlc_instance_t * p_instance)
             libvlc_MediaListPlayerNextItemSet );
     libvlc_event_manager_register_event_type( p_mlp->p_event_manager,
             libvlc_MediaListPlayerStopped );
+    libvlc_event_manager_register_event_type( p_mlp->p_event_manager,
+            libvlc_MediaListPlayerPlayed );
     p_mlp->e_playback_mode = libvlc_playback_mode_default;
 
     return p_mlp;
@@ -781,6 +783,10 @@ static int set_relative_playlist_position_and_play(
     if (!path)
     {
         libvlc_media_list_unlock(p_mlp->p_mlist);
+        /* Send list played event */
+        libvlc_event_t event;
+        event.type = libvlc_MediaListPlayerPlayed;
+        libvlc_event_send(p_mlp->p_event_manager, &event);
         return -1;
     }
 
-- 
1.8.4.5




More information about the vlc-devel mailing list