Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
libbluray
Commits
f0857ebe
Commit
f0857ebe
authored
Oct 15, 2009
by
cRTrn13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacs_open fptr in libbluray
parent
1ed5b372
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
5 deletions
+38
-5
src/bluray.c
src/bluray.c
+30
-1
src/bluray.h
src/bluray.h
+8
-4
No files found.
src/bluray.c
View file @
f0857ebe
#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
);
}
src/bluray.h
View file @
f0857ebe
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment