[vlc-commits] bluray: use bd_get_main_title()

Petri Hintukainen git at videolan.org
Thu Feb 13 12:59:19 CET 2014


vlc | branch: master | Petri Hintukainen <phintuka at users.sourceforge.net> | Thu Feb 13 13:40:26 2014 +0200| [e1a9f3305e39a221139b881c219b0ae22ecbd566] | committer: Jean-Baptiste Kempf

bluray: use bd_get_main_title()

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/bluray.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 1d34060..adc482f 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1138,13 +1138,19 @@ static void blurayUpdateTitleInfo(demux_t *p_demux, input_title_t *t, int i_titl
 static void blurayInitTitles(demux_t *p_demux, int menu_titles)
 {
     demux_sys_t *p_sys = p_demux->p_sys;
+#if BLURAY_VERSION < BLURAY_VERSION_CODE(0,5,0)
     int64_t duration = 0;
+#endif
 
     /* get and set the titles */
     unsigned i_title = menu_titles;
 
-    if (!p_sys->b_menu)
+    if (!p_sys->b_menu) {
         i_title = bd_get_titles(p_sys->bluray, TITLES_RELEVANT, 60);
+#if BLURAY_VERSION >= BLURAY_VERSION_CODE(0,5,0)
+        p_sys->i_longest_title = bd_get_main_title(p_sys->bluray);
+#endif
+    }
 
     for (unsigned int i = 0; i < i_title; i++) {
         input_title_t *t = vlc_input_title_New();
@@ -1154,10 +1160,12 @@ static void blurayInitTitles(demux_t *p_demux, int menu_titles)
         if (!p_sys->b_menu) {
             blurayUpdateTitleInfo(p_demux, t, i, -1);
 
+#if BLURAY_VERSION < BLURAY_VERSION_CODE(0,5,0)
             if (t->i_length > duration) {
                 duration = t->i_length;
                 p_sys->i_longest_title = i;
             }
+#endif
         } else if (i == 0) {
             t->psz_name = strdup(_("Top Menu"));
         } else if (i == i_title - 1) {



More information about the vlc-commits mailing list