1
0
Fork 0

Improve mmbd detection

This commit is contained in:
hpi1 2019-01-02 13:00:15 +02:00
parent 9c88a6aabe
commit a708c33bc3
3 changed files with 23 additions and 0 deletions

View File

@ -101,6 +101,13 @@ static void *_open_libaacs(int *impl_id)
if (libaacs[ii]) {
void *handle = dl_dlopen(libaacs[ii], "0");
if (handle) {
/* One more libmmbd check. This is needed if libaacs is just a link to libmmbd ... */
fptr_int32 fp;
*(void **)(&fp) = dl_dlsym(handle, "bdplus_get_code_date");
if (fp && fp(NULL) == 0) {
ii = IMPL_LIBMMBD;
}
*impl_id = ii;
BD_DEBUG(DBG_BLURAY, "Using %s for AACS\n", libaacs[ii]);
return handle;

View File

@ -105,6 +105,13 @@ static void *_libbdplus_open(int *impl_id)
if (libbdplus[ii]) {
void *handle = dl_dlopen(libbdplus[ii], "0");
if (handle) {
/* One more libmmbd check. This is needed if libbdplus is just a link to libmmbd ... */
fptr_int32 fp;
*(void **)(&fp) = dl_dlsym(handle, "bdplus_get_code_date");
if (fp && fp(NULL) == 0) {
ii = IMPL_LIBMMBD;
}
*impl_id = ii;
BD_DEBUG(DBG_BLURAY, "Using %s for BD+\n", libbdplus[ii]);
return handle;

View File

@ -683,6 +683,15 @@ const uint8_t *disc_get_data(BD_DISC *disc, int type)
if (disc->dec) {
return dec_data(disc->dec, type);
}
if (type == 0x1000) {
/* this shouldn't cause any extra optical disc access */
BD_DIR_H *d = disc->pf_dir_open_bdrom(disc->fs_handle, "MAKEMKV");
if (d) {
dir_close(d);
BD_DEBUG(DBG_FILE, "Detected MakeMKV backup data\n");
return (const uint8_t *)"mmbd;backup";
}
}
return NULL;
}