Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
libdvdcss
Commits
04cd3885
Commit
04cd3885
authored
Oct 25, 2014
by
Diego Biurrun
Browse files
libdvdcss: Factor out setting library verbosity from dvdcss_open()
parent
2a2ce58b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libdvdcss.c
View file @
04cd3885
...
...
@@ -136,6 +136,24 @@
#define mkdir(a, b) _mkdir(a)
#endif
static
void
set_verbosity
(
dvdcss_t
dvdcss
)
{
const
char
*
psz_verbose
=
getenv
(
"DVDCSS_VERBOSE"
);
dvdcss
->
b_debug
=
0
;
dvdcss
->
b_errors
=
0
;
if
(
psz_verbose
!=
NULL
)
{
int
i
=
atoi
(
psz_verbose
);
if
(
i
>=
2
)
dvdcss
->
b_debug
=
1
;
if
(
i
>=
1
)
dvdcss
->
b_errors
=
1
;
}
}
/**
* \brief Open a DVD device or directory and return a dvdcss instance.
*
...
...
@@ -154,7 +172,6 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
int
i_ret
;
const
char
*
psz_method
=
getenv
(
"DVDCSS_METHOD"
);
const
char
*
psz_verbose
=
getenv
(
"DVDCSS_VERBOSE"
);
const
char
*
psz_cache
=
getenv
(
"DVDCSS_CACHE"
);
#ifdef DVDCSS_RAW_OPEN
const
char
*
psz_raw_device
=
getenv
(
"DVDCSS_RAW_DEVICE"
);
...
...
@@ -176,17 +193,9 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
dvdcss
->
psz_error
=
"no error"
;
dvdcss
->
i_method
=
DVDCSS_METHOD_KEY
;
dvdcss
->
psz_cachefile
[
0
]
=
'\0'
;
dvdcss
->
b_debug
=
0
;
dvdcss
->
b_errors
=
0
;
/* Set library verbosity from DVDCSS_VERBOSE environment variable. */
if
(
psz_verbose
!=
NULL
)
{
int
i
=
atoi
(
psz_verbose
);
if
(
i
>=
2
)
dvdcss
->
b_debug
=
i
;
if
(
i
>=
1
)
dvdcss
->
b_errors
=
1
;
}
set_verbosity
(
dvdcss
);
/* Set DVD access method from DVDCSS_METHOD environment variable. */
if
(
psz_method
!=
NULL
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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