Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
9fd89d7b
Commit
9fd89d7b
authored
Dec 30, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export var_Inherit()
parent
6b49f721
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
include/vlc_variables.h
include/vlc_variables.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/variables.c
src/misc/variables.c
+10
-11
No files found.
include/vlc_variables.h
View file @
9fd89d7b
...
...
@@ -143,6 +143,7 @@ VLC_EXPORT( int, __var_Get, ( vlc_object_t *, const char *, vlc_value_t * ) );
VLC_EXPORT
(
int
,
var_SetChecked
,
(
vlc_object_t
*
,
const
char
*
,
int
,
vlc_value_t
)
);
VLC_EXPORT
(
int
,
var_GetChecked
,
(
vlc_object_t
*
,
const
char
*
,
int
,
vlc_value_t
*
)
);
VLC_EXPORT
(
int
,
__var_GetAndSet
,
(
vlc_object_t
*
,
const
char
*
,
int
,
vlc_value_t
)
);
VLC_EXPORT
(
int
,
var_Inherit
,
(
vlc_object_t
*
,
const
char
*
,
int
,
vlc_value_t
*
)
);
#define var_Command(a,b,c,d,e) __var_Command( VLC_OBJECT( a ), b, c, d, e )
VLC_EXPORT
(
int
,
__var_Command
,
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
const
char
*
,
char
**
)
);
...
...
src/libvlccore.sym
View file @
9fd89d7b
...
...
@@ -445,6 +445,7 @@ __var_Set
var_SetChecked
__var_TriggerCallback
__var_Type
var_Inherit
video_format_FixRgb
video_format_IsSimilar
video_format_Setup
...
...
src/misc/variables.c
View file @
9fd89d7b
...
...
@@ -160,8 +160,6 @@ static int Lookup ( variable_t **, size_t, const char * );
static
void
CheckValue
(
variable_t
*
,
vlc_value_t
*
);
static
int
InheritValue
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
*
,
int
);
static
int
TriggerCallback
(
vlc_object_t
*
,
variable_t
*
,
const
char
*
,
vlc_value_t
);
...
...
@@ -268,7 +266,7 @@ int __var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
if
(
i_type
&
VLC_VAR_DOINHERIT
)
{
if
(
InheritValue
(
p_this
,
psz_name
,
&
p_var
->
val
,
p_var
->
i_type
)
)
if
(
var_Inherit
(
p_this
,
psz_name
,
i_type
,
&
p_var
->
val
)
)
msg_Err
(
p_this
,
"cannot inherit value for %s"
,
psz_name
);
else
if
(
i_type
&
VLC_VAR_HASCHOICE
)
{
...
...
@@ -1382,16 +1380,17 @@ static void CheckValue ( variable_t *p_var, vlc_value_t *p_val )
}
}
/*****************************************************************************
* InheritValue: try to inherit the value of this variable from the closest
* ancestor objects or ultimately from the configuration.
* The function should always be entered with the object var_lock locked.
*****************************************************************************/
static
int
InheritValue
(
vlc_object_t
*
p_this
,
const
char
*
psz_name
,
vlc_value_t
*
p_val
,
int
i_type
)
/**
* Finds the value of a variable. If the specified object does not hold a
* variable with the specified name, try the parent object, and iterate until
* the top of the tree. If no match is found, the value is read from the
* configuration.
*/
int
var_Inherit
(
vlc_object_t
*
p_this
,
const
char
*
psz_name
,
int
i_type
,
vlc_value_t
*
p_val
)
{
i_type
&=
VLC_VAR_CLASS
;
for
(
vlc_object_t
*
obj
=
p_this
->
p_parent
;
obj
!=
NULL
;
obj
=
obj
->
p_parent
)
for
(
vlc_object_t
*
obj
=
p_this
;
obj
!=
NULL
;
obj
=
obj
->
p_parent
)
if
(
var_GetChecked
(
obj
,
psz_name
,
i_type
,
p_val
)
==
VLC_SUCCESS
)
return
VLC_SUCCESS
;
...
...
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