Commit a708c33b authored by Petri Hintukainen's avatar Petri Hintukainen

Improve mmbd detection

parent 9c88a6aa
Pipeline #3811 passed with stage
in 2 minutes and 45 seconds
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment