[libbluray-devel] [Git][videolan/libbluray][master] 3 commits: Allow menuless playback without index.bdmv

Petri Hintukainen gitlab at videolan.org
Mon Feb 18 17:33:02 CET 2019


Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
7c56a70f by hpi1 at 2019-02-18T16:32:04Z
Allow menuless playback without index.bdmv

- - - - -
49169d8d by hpi1 at 2019-02-18T16:32:04Z
Drop double attribute

- - - - -
a797b4a2 by hpi1 at 2019-02-18T16:32:04Z
disc: do not use empty pseudo id

- - - - -


3 changed files:

- src/libbluray/bluray.c
- src/libbluray/disc/disc.c
- src/libbluray/disc/disc.h


Changes:

=====================================
src/libbluray/bluray.c
=====================================
@@ -957,6 +957,15 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
     if (bd->disc) {
         bd->disc_info.udf_volume_id = disc_volume_id(bd->disc);
         index = indx_get(bd->disc);
+        if (!index) {
+            /* check for incomplete disc */
+            int r = bd_get_titles(bd, 0, 0);
+            if (r > 0) {
+                BD_DEBUG(DBG_BLURAY | DBG_CRIT, "Possible incomplete BluRay image detected. No menu support.\n");
+                bd->disc_info.bluray_detected = 1;
+                bd->disc_info.no_menu_support = 1;
+            }
+        }
     }
 
     if (index) {


=====================================
src/libbluray/disc/disc.c
=====================================
@@ -591,11 +591,6 @@ static char *_properties_file(BD_DISC *p)
     char    *cache_home;
     char    *properties_file;
 
-    cache_home = file_get_cache_home();
-    if (!cache_home) {
-        return NULL;
-    }
-
     /* get disc ID */
     if (p->dec) {
         id_type = 'A';
@@ -603,8 +598,17 @@ static char *_properties_file(BD_DISC *p)
     }
     if (!disc_id) {
         id_type = 'P';
-        disc_pseudo_id(p, pseudo_id);
-        disc_id = pseudo_id;
+        if (disc_pseudo_id(p, pseudo_id) > 0) {
+            disc_id = pseudo_id;
+        }
+    }
+    if (!disc_id) {
+        return NULL;
+    }
+
+    cache_home = file_get_cache_home();
+    if (!cache_home) {
+        return NULL;
     }
 
     properties_file = str_printf("%s" DIR_SEP "bluray" DIR_SEP "properties" DIR_SEP "%c%s",
@@ -784,16 +788,18 @@ static int _hash_file(BD_DISC *p, const char *dir, const char *file, void *hash)
     return sz > 16;
 }
 
-BD_PRIVATE void disc_pseudo_id(BD_DISC *p, uint8_t *id/*[20]*/)
+int disc_pseudo_id(BD_DISC *p, uint8_t *id/*[20]*/)
 {
     uint8_t h[2][20];
-    int i;
+    int i, r = 0;
 
     memset(h, 0, sizeof(h));
-    _hash_file(p, "BDMV", "MovieObject.bdmv", h[0]);
-    _hash_file(p, "BDMV", "index.bdmv", h[1]);
+    r += _hash_file(p, "BDMV", "MovieObject.bdmv", h[0]);
+    r += _hash_file(p, "BDMV", "index.bdmv", h[1]);
 
     for (i = 0; i < 20; i++) {
         id[i] = h[0][i] ^ h[1][i];
     }
+
+    return r > 0;
 }


=====================================
src/libbluray/disc/disc.h
=====================================
@@ -64,7 +64,7 @@ BD_PRIVATE const char *disc_root(BD_DISC *disc);
 BD_PRIVATE const char *disc_volume_id(BD_DISC *);
 
 /* Generate pseudo disc ID */
-BD_PRIVATE void disc_pseudo_id(BD_DISC *, uint8_t *id/*[20]*/);
+BD_PRIVATE int disc_pseudo_id(BD_DISC *, uint8_t *id/*[20]*/);
 
 /* Open VFS file (relative to disc root) */
 BD_PRIVATE struct bd_file_s *disc_open_file(BD_DISC *disc, const char *dir, const char *file);



View it on GitLab: https://code.videolan.org/videolan/libbluray/compare/75bb45d9625dbf5b8f3332235d8f86c69fa1594d...a797b4a20eade13a3fe3cf76a538062d3b8ec95f

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/compare/75bb45d9625dbf5b8f3332235d8f86c69fa1594d...a797b4a20eade13a3fe3cf76a538062d3b8ec95f
You're receiving this email because of your account on code.videolan.org.


More information about the libbluray-devel mailing list