[vlc-commits] libvlc: add a new event fired if the chapter changes

Felix Paul Kühne git at videolan.org
Wed Nov 25 11:54:18 CET 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Nov 24 16:33:40 2015 +0100| [5f5121a8d893073acc366321b9c36361e2162126] | committer: Felix Paul Kühne

libvlc: add a new event fired if the chapter changes

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

 include/vlc/libvlc_events.h |    5 +++++
 lib/media_player.c          |    6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
index a770b06..4da43f6 100644
--- a/include/vlc/libvlc_events.h
+++ b/include/vlc/libvlc_events.h
@@ -83,6 +83,7 @@ enum libvlc_event_e {
     libvlc_MediaPlayerUnmuted,
     libvlc_MediaPlayerAudioVolume,
     libvlc_MediaPlayerAudioDevice,
+    libvlc_MediaPlayerChapterChanged,
 
     libvlc_MediaListItemAdded=0x200,
     libvlc_MediaListWillAddItem,
@@ -161,6 +162,10 @@ typedef struct libvlc_event_t
         } media_player_buffering;
         struct
         {
+            int new_chapter;
+        } media_player_chapter_changed;
+        struct
+        {
             float new_position;
         } media_player_position_changed;
         struct
diff --git a/lib/media_player.c b/lib/media_player.c
index cdbe432..8b6938c 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -372,6 +372,12 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
         event.u.media_player_title_changed.new_title = var_GetInteger( p_input, "title" );
         libvlc_event_send( p_mi->p_event_manager, &event );
     }
+    else if ( newval.i_int == INPUT_EVENT_CHAPTER )
+    {
+        event.type = libvlc_MediaPlayerChapterChanged;
+        event.u.media_player_chapter_changed.new_chapter = var_GetInteger( p_input, "chapter" );
+        libvlc_event_send( p_mi->p_event_manager, &event );
+    }
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list