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
e1bd4f03
Commit
e1bd4f03
authored
Aug 19, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics
parent
9f5bed00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
+13
-21
src/misc/variables.c
src/misc/variables.c
+13
-21
No files found.
src/misc/variables.c
View file @
e1bd4f03
...
@@ -390,7 +390,6 @@ void var_DestroyAll( vlc_object_t *obj )
...
@@ -390,7 +390,6 @@ void var_DestroyAll( vlc_object_t *obj )
int
var_Change
(
vlc_object_t
*
p_this
,
const
char
*
psz_name
,
int
var_Change
(
vlc_object_t
*
p_this
,
const
char
*
psz_name
,
int
i_action
,
vlc_value_t
*
p_val
,
vlc_value_t
*
p_val2
)
int
i_action
,
vlc_value_t
*
p_val
,
vlc_value_t
*
p_val2
)
{
{
int
i
;
int
ret
=
VLC_SUCCESS
;
int
ret
=
VLC_SUCCESS
;
variable_t
*
p_var
;
variable_t
*
p_var
;
vlc_value_t
oldval
;
vlc_value_t
oldval
;
...
@@ -460,7 +459,8 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
...
@@ -460,7 +459,8 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
ret
=
VLC_EGENERIC
;
ret
=
VLC_EGENERIC
;
break
;
break
;
case
VLC_VAR_ADDCHOICE
:
case
VLC_VAR_ADDCHOICE
:
i
=
p_var
->
choices
.
i_count
;
{
int
i
=
p_var
->
choices
.
i_count
;
INSERT_ELEM
(
p_var
->
choices
.
p_values
,
p_var
->
choices
.
i_count
,
INSERT_ELEM
(
p_var
->
choices
.
p_values
,
p_var
->
choices
.
i_count
,
i
,
*
p_val
);
i
,
*
p_val
);
...
@@ -473,14 +473,14 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
...
@@ -473,14 +473,14 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
CheckValue
(
p_var
,
&
p_var
->
val
);
CheckValue
(
p_var
,
&
p_var
->
val
);
break
;
break
;
}
case
VLC_VAR_DELCHOICE
:
case
VLC_VAR_DELCHOICE
:
{
int
i
;
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
if
(
p_var
->
ops
->
pf_cmp
(
p_var
->
choices
.
p_values
[
i
],
*
p_val
)
==
0
)
if
(
p_var
->
ops
->
pf_cmp
(
p_var
->
choices
.
p_values
[
i
],
*
p_val
)
==
0
)
{
break
;
break
;
}
}
if
(
i
==
p_var
->
choices
.
i_count
)
if
(
i
==
p_var
->
choices
.
i_count
)
{
{
...
@@ -490,13 +490,9 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
...
@@ -490,13 +490,9 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
}
}
if
(
p_var
->
i_default
>
i
)
if
(
p_var
->
i_default
>
i
)
{
p_var
->
i_default
--
;
p_var
->
i_default
--
;
}
else
if
(
p_var
->
i_default
==
i
)
else
if
(
p_var
->
i_default
==
i
)
{
p_var
->
i_default
=
-
1
;
p_var
->
i_default
=
-
1
;
}
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
...
@@ -506,15 +502,14 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
...
@@ -506,15 +502,14 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
CheckValue
(
p_var
,
&
p_var
->
val
);
CheckValue
(
p_var
,
&
p_var
->
val
);
break
;
break
;
}
case
VLC_VAR_CHOICESCOUNT
:
case
VLC_VAR_CHOICESCOUNT
:
p_val
->
i_int
=
p_var
->
choices
.
i_count
;
p_val
->
i_int
=
p_var
->
choices
.
i_count
;
break
;
break
;
case
VLC_VAR_CLEARCHOICES
:
case
VLC_VAR_CLEARCHOICES
:
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
for
(
int
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
p_var
->
ops
->
pf_free
(
&
p_var
->
choices
.
p_values
[
i
]
);
}
for
(
int
i
=
0
;
i
<
p_var
->
choices_text
.
i_count
;
i
++
)
for
(
i
=
0
;
i
<
p_var
->
choices_text
.
i_count
;
i
++
)
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
free
(
p_var
->
choices_text
.
p_values
[
i
].
psz_string
);
if
(
p_var
->
choices
.
i_count
)
free
(
p_var
->
choices
.
p_values
);
if
(
p_var
->
choices
.
i_count
)
free
(
p_var
->
choices
.
p_values
);
...
@@ -527,24 +522,21 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
...
@@ -527,24 +522,21 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
p_var
->
i_default
=
-
1
;
p_var
->
i_default
=
-
1
;
break
;
break
;
case
VLC_VAR_SETDEFAULT
:
case
VLC_VAR_SETDEFAULT
:
{
int
i
;
/* FIXME: the list is sorted, dude. Use something cleverer. */
/* FIXME: the list is sorted, dude. Use something cleverer. */
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
if
(
p_var
->
ops
->
pf_cmp
(
p_var
->
choices
.
p_values
[
i
],
*
p_val
)
==
0
)
if
(
p_var
->
ops
->
pf_cmp
(
p_var
->
choices
.
p_values
[
i
],
*
p_val
)
==
0
)
{
break
;
break
;
}
}
if
(
i
==
p_var
->
choices
.
i_count
)
if
(
i
==
p_var
->
choices
.
i_count
)
{
/* Not found */
/* Not found */
break
;
break
;
}
p_var
->
i_default
=
i
;
p_var
->
i_default
=
i
;
CheckValue
(
p_var
,
&
p_var
->
val
);
CheckValue
(
p_var
,
&
p_var
->
val
);
break
;
break
;
}
case
VLC_VAR_SETVALUE
:
case
VLC_VAR_SETVALUE
:
/* Duplicate data if needed */
/* Duplicate data if needed */
newval
=
*
p_val
;
newval
=
*
p_val
;
...
@@ -578,7 +570,7 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
...
@@ -578,7 +570,7 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
}
}
p_val
->
p_list
->
i_count
=
p_var
->
choices
.
i_count
;
p_val
->
p_list
->
i_count
=
p_var
->
choices
.
i_count
;
if
(
p_val2
)
p_val2
->
p_list
->
i_count
=
p_var
->
choices
.
i_count
;
if
(
p_val2
)
p_val2
->
p_list
->
i_count
=
p_var
->
choices
.
i_count
;
for
(
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
p_var
->
choices
.
i_count
;
i
++
)
{
{
p_val
->
p_list
->
p_values
[
i
]
=
p_var
->
choices
.
p_values
[
i
];
p_val
->
p_list
->
p_values
[
i
]
=
p_var
->
choices
.
p_values
[
i
];
p_val
->
p_list
->
pi_types
[
i
]
=
p_var
->
i_type
;
p_val
->
p_list
->
pi_types
[
i
]
=
p_var
->
i_type
;
...
...
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