Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libbluray
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
libbluray
Commits
586b2913
Commit
586b2913
authored
Oct 19, 2009
by
cRTrn13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed logging
parent
fba8d177
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
35 deletions
+58
-35
src/bluray.c
src/bluray.c
+23
-0
src/bluray.h
src/bluray.h
+1
-2
src/util/logging.c
src/util/logging.c
+34
-0
src/util/logging.h
src/util/logging.h
+0
-33
No files found.
src/bluray.c
View file @
586b2913
...
...
@@ -13,6 +13,7 @@ BLURAY *bd_open(const char* device_path, const char* keyfile_path)
bd
->
aacs
=
NULL
;
bd
->
h_libaacs
=
NULL
;
bd
->
fp
=
NULL
;
strncpy
(
bd
->
device_path
,
device_path
,
100
);
// open aacs decryptor if present
if
((
bd
->
h_libaacs
=
dlopen
(
"libaacs.so"
,
RTLD_LAZY
)))
{
...
...
@@ -83,3 +84,25 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
return
0
;
}
int
bd_select_title
(
BLURAY
*
bd
,
uint64_t
title
)
{
char
f_name
[
100
];
memset
(
f_name
,
0
,
sizeof
(
f_name
));
snprintf
(
f_name
,
100
,
"%s/BDMV/STREAM/%05ld.m2ts"
,
bd
->
device_path
,
title
);
bd
->
s_size
=
0
;
bd
->
s_pos
=
0
;
if
((
bd
->
fp
=
file_open
(
f_name
,
"rb"
)))
{
file_seek
(
bd
->
fp
,
0
,
SEEK_END
);
if
((
bd
->
s_size
=
file_tell
(
bd
->
fp
)))
{
file_seek
(
bd
->
fp
,
0
,
SEEK_SET
);
return
1
;
}
}
return
0
;
}
src/bluray.h
View file @
586b2913
...
...
@@ -14,7 +14,6 @@ typedef struct bluray BLURAY;
struct
bluray
{
char
device_path
[
100
];
FILE_H
*
fp
;
uint64_t
title
;
uint64_t
s_size
;
off_t
s_pos
;
AACS_KEYS
*
aacs
;
...
...
@@ -24,8 +23,8 @@ struct bluray {
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
,
uint64_t
pos
);
int
bd_read
(
BLURAY
*
bd
,
unsigned
char
*
buf
,
int
len
);
int
bd_select_title
(
BLURAY
*
bd
,
uint64_t
title
);
#endif
/* BLURAY_H_ */
src/util/logging.c
0 → 100644
View file @
586b2913
#include "logging.h"
const
uint32_t
master_mask
=
0xffff
;
// this is only temporary
char
out
[
512
];
char
*
print_hex
(
uint8_t
*
buf
,
int
count
)
{
memset
(
out
,
0
,
count
);
int
zz
;
for
(
zz
=
0
;
zz
<
count
;
zz
++
)
{
sprintf
(
out
+
(
zz
*
2
),
"%02X"
,
buf
[
zz
]);
}
return
out
;
}
void
debug
(
char
*
file
,
int
line
,
uint32_t
mask
,
const
char
*
format
,
...)
{
uint32_t
type
=
(
mask
&
master_mask
)
&
0xfffe
,
verbose
=
!
((
!
(
master_mask
&
1
))
&
(
mask
&
1
));
if
(
type
&&
verbose
)
{
char
buffer
[
512
];
va_list
args
;
va_start
(
args
,
format
);
vsprintf
(
buffer
,
format
,
args
);
va_end
(
args
);
fprintf
(
stderr
,
"%s:%d: %s"
,
file
,
line
,
buffer
);
}
}
src/util/logging.h
View file @
586b2913
...
...
@@ -18,40 +18,7 @@ enum {
DBG_BLURAY
=
64
}
debug_mask
;
const
uint32_t
master_mask
=
0xffff
;
// this is only temporary
char
out
[
512
];
char
*
print_hex
(
uint8_t
*
str
,
int
count
);
void
debug
(
char
*
file
,
int
line
,
uint32_t
mask
,
const
char
*
format
,
...);
char
*
print_hex
(
uint8_t
*
buf
,
int
count
)
{
memset
(
out
,
0
,
count
);
int
zz
;
for
(
zz
=
0
;
zz
<
count
;
zz
++
)
{
sprintf
(
out
+
(
zz
*
2
),
"%02X"
,
buf
[
zz
]);
}
return
out
;
}
void
debug
(
char
*
file
,
int
line
,
uint32_t
mask
,
const
char
*
format
,
...)
{
uint32_t
type
=
(
mask
&
master_mask
)
&
0xfffe
,
verbose
=
!
((
!
(
master_mask
&
1
))
&
(
mask
&
1
));
if
(
type
&&
verbose
)
{
char
buffer
[
512
];
va_list
args
;
va_start
(
args
,
format
);
vsprintf
(
buffer
,
format
,
args
);
va_end
(
args
);
fprintf
(
stderr
,
"%s:%d: %s"
,
file
,
line
,
buffer
);
}
}
#endif
/* LOGGING_H_ */
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