Commit f0857ebe authored by cRTrn13's avatar cRTrn13

aacs_open fptr in libbluray

parent 1ed5b372
#include <dlfcn.h>
#include "bluray.h"
#include "libaacs/aacs.h"
#include "util/macro.h"
BLURAY *bd_open(const char* device_path, const char* keyfile_path)
{
BLURAY *bd = malloc(sizeof(BLURAY));
// open aacs decryptor if present
bd->aacs = NULL;
if ((bd->libaacs_h = dlopen("libaacs", RTLD_NOW))) {
typedef AACS_KEYS* (*fptr)();
fptr fptr_s = dlsym(bd->libaacs_h, "aacs_open");
bd->aacs = fptr_s(device_path, keyfile_path);
}
return bd;
}
void bd_close(BLURAY *bd)
{
if (bd->libaacs_h) {
aacs_close(bd->aacs);
}
X_FREE(bd);
dlclose(bd->libbdplus_h);
dlclose(bd->libaacs_h);
}
......@@ -6,18 +6,22 @@
#include <unistd.h>
#include "file/file.h"
#include "libaacs/aacs.h"
typedef struct bluray BLURAY;
struct bluray {
char device_path[100];
uint64_t title;
FILE_H *fp;
off_t s_size, s_pos;
uint64_t title;
uint64_t s_size;
off_t s_pos;
AACS_KEYS *aacs;
void *libaacs_h, *libbdplus_h;
};
BLURAY *bd_open(BLURAY *bd);
void bd_select_title(BLURAY *bd, uint64_t title);
BLURAY *bd_open(const char* device_path, const char* keyfile_path);
void bd_close(BLURAY *bd);
void bd_select_title(BLURAY *bd, uint64_t title);
off_t bd_seek(BLURAY *bd, off_t pos);
int bd_read(BLURAY *bd, unsigned char *buf, int len);
......
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