Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
74b1c6cd
Commit
74b1c6cd
authored
Mar 17, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code factorization: use input_ItemAddOption
parent
25ea83eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
29 deletions
+10
-29
src/input/control.c
src/input/control.c
+10
-29
No files found.
src/input/control.c
View file @
74b1c6cd
...
@@ -498,38 +498,19 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
...
@@ -498,38 +498,19 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
case
INPUT_ADD_OPTION
:
case
INPUT_ADD_OPTION
:
{
{
char
*
psz_option
=
(
char
*
)
va_arg
(
args
,
char
*
);
const
char
*
psz_option
=
va_arg
(
args
,
const
char
*
);
char
*
psz_value
=
(
char
*
)
va_arg
(
args
,
char
*
);
const
char
*
psz_value
=
va_arg
(
args
,
const
char
*
);
char
*
str
;
int
i
;
int
i
;
vlc_mutex_lock
(
&
p_input
->
p
->
input
.
p_item
->
lock
);
if
(
asprintf
(
&
str
,
"%s=%s"
,
psz_option
,
psz_value
)
==
-
1
)
/* Check if option already exists */
return
VLC_ENOMEM
;
for
(
i
=
0
;
i
<
p_input
->
p
->
input
.
p_item
->
i_options
;
i
++
)
{
if
(
!
strncmp
(
p_input
->
p
->
input
.
p_item
->
ppsz_options
[
i
],
psz_option
,
strlen
(
psz_option
)
)
&&
p_input
->
p
->
input
.
p_item
->
ppsz_options
[
i
][
strlen
(
psz_option
)]
==
'='
)
{
free
(
p_input
->
p
->
input
.
p_item
->
ppsz_options
[
i
]
);
break
;
}
}
if
(
i
==
p_input
->
p
->
input
.
p_item
->
i_options
)
{
p_input
->
p
->
input
.
p_item
->
i_options
++
;
p_input
->
p
->
input
.
p_item
->
ppsz_options
=
realloc
(
p_input
->
p
->
input
.
p_item
->
ppsz_options
,
p_input
->
p
->
input
.
p_item
->
i_options
*
sizeof
(
char
**
)
);
}
if
(
asprintf
(
&
p_input
->
p
->
input
.
p_item
->
ppsz_options
[
i
],
input_ItemAddOpt
(
p_input
->
p
->
input
.
p_item
,
str
,
"%s=%s"
,
psz_option
,
psz_value
)
==
-
1
)
VLC_INPUT_OPTION_UNIQUE
);
p_input
->
p
->
input
.
p_item
->
ppsz_options
[
i
]
=
NULL
;
i
=
VLC_SUCCESS
;
vlc_mutex_unlock
(
&
p_input
->
p
->
input
.
p_item
->
lock
);
free
(
str
);
return
i
;
return
VLC_SUCCESS
;
}
}
case
INPUT_GET_BYTE_POSITION
:
case
INPUT_GET_BYTE_POSITION
:
...
...
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