[vlc-devel] [PATCH 1/3] libvlc: rename TitleChanged to TitleSelectionChanged

Thomas Guillem thomas at gllm.fr
Tue Apr 28 13:46:44 CEST 2020


In 3.0, this event was sent for a new selection and for a new list.

RFC: Even if 4.0 break the API/ABI, I would prefer to not change the event enum
order. Indeed, libvlc is used by some languages that don't have enum and that
have to use a const int value for each of these enums.
---
 include/vlc/libvlc_events.h | 5 +++--
 lib/media_player.c          | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
index 62a81104da..c901c8079d 100644
--- a/include/vlc/libvlc_events.h
+++ b/include/vlc/libvlc_events.h
@@ -104,7 +104,7 @@ enum libvlc_event_e {
     libvlc_MediaPlayerPositionChanged,
     libvlc_MediaPlayerSeekableChanged,
     libvlc_MediaPlayerPausableChanged,
-    libvlc_MediaPlayerTitleChanged,
+    libvlc_MediaPlayerDeprecated01, /* libvlc_MediaPlayerTitleChanged */
     libvlc_MediaPlayerSnapshotTaken,
     libvlc_MediaPlayerLengthChanged,
     libvlc_MediaPlayerVout,
@@ -118,6 +118,7 @@ enum libvlc_event_e {
     libvlc_MediaPlayerUnmuted,
     libvlc_MediaPlayerAudioVolume,
     libvlc_MediaPlayerAudioDevice,
+    libvlc_MediaPlayerTitleSelectionChanged,
     libvlc_MediaPlayerChapterChanged,
 
     /**
@@ -266,7 +267,7 @@ typedef struct libvlc_event_t
         struct
         {
             int new_title;
-        } media_player_title_changed;
+        } media_player_title_selection_changed;
         struct
         {
             int new_seekable;
diff --git a/lib/media_player.c b/lib/media_player.c
index 96af310c34..42d20537c6 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -343,8 +343,8 @@ on_title_selection_changed(vlc_player_t *player,
     libvlc_media_player_t *mp = data;
 
     libvlc_event_t event;
-    event.type = libvlc_MediaPlayerTitleChanged;
-    event.u.media_player_title_changed.new_title = new_idx;
+    event.type = libvlc_MediaPlayerTitleSelectionChanged;
+    event.u.media_player_title_selection_changed.new_title = new_idx;
 
     libvlc_event_send(&mp->event_manager, &event);
 }
-- 
2.20.1



More information about the vlc-devel mailing list