[vlc-devel] [PATCH] libvlc: replace existing title menu bool with int bit mask

Felix Paul Kühne fkuehne at videolan.org
Fri Dec 18 15:29:43 CET 2015


---
 include/vlc/libvlc_media_player.h | 8 +++++++-
 include/vlc_input.h               | 4 ++--
 lib/media_player.c                | 2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 6614340..3f26998 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -57,11 +57,17 @@ typedef struct libvlc_track_description_t
 /**
  * Description for titles
  */
+enum
+{
+    libvlc_title_menu          = 0x01,
+    libvlc_title_interactive   = 0x02
+};
+
 typedef struct libvlc_title_description_t
 {
     int64_t i_duration; /**< duration in milliseconds */
     char *psz_name; /**< title name */
-    bool b_menu; /**< info if item was recognized as a menu by the demuxer */
+    int i_flags; /**< info if item was recognized as a menu, interactive or plain content by the demuxer */
 } libvlc_title_description_t;
 
 /**
diff --git a/include/vlc_input.h b/include/vlc_input.h
index fbe7f79..840519b 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -84,8 +84,8 @@ static inline seekpoint_t *vlc_seekpoint_Duplicate( const seekpoint_t *src )
  *****************************************************************************/
 
 /* input_title_t.i_flags field */
-#define INPUT_TITLE_MENU         0x0001   /* Menu title */
-#define INPUT_TITLE_INTERACTIVE  0x0002   /* Interactive title. Playback position has no meaning. */
+#define INPUT_TITLE_MENU         0x01   /* Menu title */
+#define INPUT_TITLE_INTERACTIVE  0x02   /* Interactive title. Playback position has no meaning. */
 
 typedef struct input_title_t
 {
diff --git a/lib/media_player.c b/lib/media_player.c
index 2dee2d7..58b2de9 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1476,7 +1476,7 @@ int libvlc_media_player_get_full_title_descriptions( libvlc_media_player_t *p_mi
 
         /* we want to return milliseconds to match the rest of the API */
         title->i_duration = p_input_title[i]->i_length / 1000;
-        title->b_menu = p_input_title[i]->i_flags & INPUT_TITLE_MENU;
+        title->i_flags = p_input_title[i]->i_flags;
         if( p_input_title[i]->psz_name )
             title->psz_name = strdup( p_input_title[i]->psz_name );
         else
-- 
2.6.4



More information about the vlc-devel mailing list