[libbluray-devel] DISC_INFO: add flag for on-disc menu support.
hpi1
git at videolan.org
Mon Feb 8 11:02:57 CET 2016
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Feb 8 11:46:28 2016 +0200| [e5031a387ea9ff57a92ae480bb53b222cd90bbaf] | committer: hpi1
DISC_INFO: add flag for on-disc menu support.
Error out in bd_play() if menus are not supported.
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=e5031a387ea9ff57a92ae480bb53b222cd90bbaf
---
src/libbluray/bluray.c | 10 ++++++++++
src/libbluray/bluray.h | 3 +++
src/libbluray/disc/dec.c | 7 +++++++
src/libbluray/disc/enc_info.h | 2 ++
4 files changed, 22 insertions(+)
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 2164a23..aad7a85 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -952,6 +952,7 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
bd->disc_info.bdplus_handled = enc_info->bdplus_handled;
bd->disc_info.bdplus_gen = enc_info->bdplus_gen;
bd->disc_info.bdplus_date = enc_info->bdplus_date;
+ bd->disc_info.no_menu_support = enc_info->no_menu_support;
bd->disc_info.udf_volume_id = disc_volume_id(bd->disc);
@@ -1098,6 +1099,10 @@ static void _fill_disc_info(BLURAY *bd, BD_ENC_INFO *enc_info)
indx_free(&index);
}
+ if (!bd->disc_info.first_play_supported || !bd->disc_info.top_menu_supported) {
+ bd->disc_info.no_menu_support = 1;
+ }
+
if (bd->disc_info.bdj_detected) {
BDID_DATA *bdid = bdid_get(bd->disc); /* parse id.bdmv */
if (bdid) {
@@ -3122,6 +3127,11 @@ static int _play_title(BLURAY *bd, unsigned title)
return 0;
}
+ if (bd->disc_info.no_menu_support) {
+ BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_play(): no menu support\n");
+ return 0;
+ }
+
/* first play object ? */
if (title == BLURAY_TITLE_FIRST_PLAY) {
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index ae9f412..11e2eb6 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -119,6 +119,9 @@ typedef struct {
char bdj_disc_id[33]; /* (BD-J) disc ID */
const char *udf_volume_id; /* optional UDF volume identifier */
+
+ uint8_t no_menu_support; /* 1 if this disc can't be played using on-disc menus */
+
} BLURAY_DISC_INFO;
/*
diff --git a/src/libbluray/disc/dec.c b/src/libbluray/disc/dec.c
index 8c601f7..635e83b 100644
--- a/src/libbluray/disc/dec.c
+++ b/src/libbluray/disc/dec.c
@@ -259,6 +259,13 @@ static int _libbdplus_init(BD_DEC *dec, struct dec_dev *dev,
i->bdplus_gen = libbdplus_get_gen(dec->bdplus);
i->bdplus_date = libbdplus_get_date(dec->bdplus);
i->bdplus_handled = 1;
+
+ if (i->bdplus_date == 0) {
+ // libmmbd -> no menu support
+ BD_DEBUG(DBG_BLURAY | DBG_CRIT, "WARNING: using libmmbd for BD+. On-disc menus will not work.\n");
+ i->no_menu_support = 1;
+ }
+
return 1;
}
diff --git a/src/libbluray/disc/enc_info.h b/src/libbluray/disc/enc_info.h
index d45d891..47ca94f 100644
--- a/src/libbluray/disc/enc_info.h
+++ b/src/libbluray/disc/enc_info.h
@@ -34,6 +34,8 @@ typedef struct bd_enc_info {
uint8_t disc_id[20];
uint8_t bdplus_gen;
uint32_t bdplus_date;
+
+ uint8_t no_menu_support;
} BD_ENC_INFO;
#endif /* _BD_DISC_ENC_INFO_H_ */
More information about the libbluray-devel
mailing list