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

Felix Paul Kühne git at videolan.org
Mon Dec 21 11:44:01 CET 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Dec  2 15:18:49 2015 +0100| [a527e9d08638f4c2de7c7fe4eb18ae6e5831c3fe] | committer: Felix Paul Kühne

libvlc: replace existing title menu bool with int bit mask

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

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

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 6614340..76443c1 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 */
+    unsigned 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..0bda6d4 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
 {
@@ -93,7 +93,7 @@ typedef struct input_title_t
 
     int64_t     i_length;   /* Length(microsecond) if known, else 0 */
 
-    int         i_flags;    /* Is it a menu or a normal entry */
+    unsigned    i_flags;    /* Is it a menu or a normal entry */
 
     /* Title seekpoint */
     int         i_seekpoint;
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



More information about the vlc-commits mailing list