[vlc-commits] [Git][videolan/vlc][master] 3 commits: input: add a flag for main title

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Wed Jun 8 07:49:06 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
601d48aa by Rémi Denis-Courmont at 2022-06-08T07:11:06+00:00
input: add a flag for main title

Fixes #19429.

- - - - -
bf68a015 by Rémi Denis-Courmont at 2022-06-08T07:11:06+00:00
bluray: the main title is the "main" title

...no the "longest" title.

- - - - -
f6a6b9b9 by Rémi Denis-Courmont at 2022-06-08T07:11:06+00:00
bluray: set main flag on main title

- - - - -


4 changed files:

- include/vlc_input.h
- include/vlc_player.h
- modules/access/bluray.c
- src/player/player.c


Changes:

=====================================
include/vlc_input.h
=====================================
@@ -88,6 +88,7 @@ static inline seekpoint_t *vlc_seekpoint_Duplicate( const seekpoint_t *src )
 /* input_title_t.i_flags field */
 #define INPUT_TITLE_MENU         0x01   /* Menu title */
 #define INPUT_TITLE_INTERACTIVE  0x02   /* Interactive title. Playback position has no meaning. */
+#define INPUT_TITLE_MAIN         0x04   /* Main title */
 
 typedef struct input_title_t
 {


=====================================
include/vlc_player.h
=====================================
@@ -949,6 +949,8 @@ struct vlc_player_chapter
 #define VLC_PLAYER_TITLE_MENU         0x01
 /** vlc_player_title.flags: The title is interactive. */
 #define VLC_PLAYER_TITLE_INTERACTIVE  0x02
+/** vlc_player_title.flags: The title is the main one. */
+#define VLC_PLAYER_TITLE_MAIN         0x04
 
 /** Player title structure */
 struct vlc_player_title


=====================================
modules/access/bluray.c
=====================================
@@ -297,7 +297,7 @@ typedef struct
 
     /* Titles */
     unsigned int        i_title;
-    unsigned int        i_longest_title;
+    unsigned int        i_main_title;
     input_title_t       **pp_title;
     unsigned            cur_title;
     unsigned            cur_seekpoint;
@@ -1032,8 +1032,8 @@ static int blurayOpen(vlc_object_t *object)
 
     } else {
         /* set start title number */
-        if (bluraySetTitle(p_demux, p_sys->i_longest_title) != VLC_SUCCESS) {
-            msg_Err(p_demux, "Could not set the title %d", p_sys->i_longest_title);
+        if (bluraySetTitle(p_demux, p_sys->i_main_title) != VLC_SUCCESS) {
+            msg_Err(p_demux, "Could not set the title %d", p_sys->i_main_title);
             goto error;
         }
     }
@@ -2236,7 +2236,7 @@ static void blurayInitTitles(demux_t *p_demux, uint32_t menu_titles)
 
     if (!p_sys->b_menu) {
         i_title = bd_get_titles(p_sys->bluray, TITLES_RELEVANT, 60);
-        p_sys->i_longest_title = bd_get_main_title(p_sys->bluray);
+        p_sys->i_main_title = bd_get_main_title(p_sys->bluray);
     }
 
     for (uint32_t i = 0; i < i_title; i++) {
@@ -2271,6 +2271,9 @@ static void blurayInitTitles(demux_t *p_demux, uint32_t menu_titles)
 
         TAB_APPEND(p_sys->i_title, p_sys->pp_title, t);
     }
+
+    if (p_sys->i_main_title < p_sys->i_title)
+        p_sys->pp_title[p_sys->i_main_title]->i_flags |= INPUT_TITLE_MAIN;
 }
 
 static void blurayRestartParser(demux_t *p_demux, bool b_flush, bool b_random_access)
@@ -2328,9 +2331,9 @@ static int bluraySetTitle(demux_t *p_demux, int i_title)
         return VLC_SUCCESS;
     }
 
-    /* Looking for the main title, ie the longest duration */
+    /* Looking for the main title */
     if (i_title < 0)
-        i_title = p_sys->i_longest_title;
+        i_title = p_sys->i_main_title;
     else if ((unsigned)i_title > p_sys->i_title)
         return VLC_EGENERIC;
 


=====================================
src/player/player.c
=====================================
@@ -44,7 +44,8 @@ static_assert(VLC_PLAYER_CAP_SEEK == VLC_INPUT_CAPABILITIES_SEEKABLE &&
               "player/input capabilities mismatch");
 
 static_assert(VLC_PLAYER_TITLE_MENU == INPUT_TITLE_MENU &&
-              VLC_PLAYER_TITLE_INTERACTIVE == INPUT_TITLE_INTERACTIVE,
+              VLC_PLAYER_TITLE_INTERACTIVE == INPUT_TITLE_INTERACTIVE &&
+              VLC_PLAYER_TITLE_MAIN == INPUT_TITLE_MAIN,
               "player/input title flag mismatch");
 
 #define vlc_player_foreach_inputs(it) \



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/797e1f3b979fca463030608db1513a81228c624c...f6a6b9b93dd257ddcb87ee6c8bfd80bacb449ad9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/797e1f3b979fca463030608db1513a81228c624c...f6a6b9b93dd257ddcb87ee6c8bfd80bacb449ad9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list