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
23b4f051
Commit
23b4f051
authored
May 23, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: remove a heap allocation, small simplification
parent
9e815e5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
src/input/var.c
src/input/var.c
+10
-17
No files found.
src/input/var.c
View file @
23b4f051
...
@@ -255,8 +255,7 @@ void input_ControlVarStop( input_thread_t *p_input )
...
@@ -255,8 +255,7 @@ void input_ControlVarStop( input_thread_t *p_input )
*****************************************************************************/
*****************************************************************************/
void
input_ControlVarNavigation
(
input_thread_t
*
p_input
)
void
input_ControlVarNavigation
(
input_thread_t
*
p_input
)
{
{
vlc_value_t
val
,
text
;
vlc_value_t
text
;
int
i
;
/* Create more command variables */
/* Create more command variables */
if
(
p_input
->
p
->
i_title
>
1
)
if
(
p_input
->
p
->
i_title
>
1
)
...
@@ -272,24 +271,20 @@ void input_ControlVarNavigation( input_thread_t *p_input )
...
@@ -272,24 +271,20 @@ void input_ControlVarNavigation( input_thread_t *p_input )
var_AddCallback
(
p_input
,
"prev-title"
,
TitleCallback
,
NULL
);
var_AddCallback
(
p_input
,
"prev-title"
,
TitleCallback
,
NULL
);
}
}
/* Create title and navigation */
/* Create titles and chapters */
val
.
psz_string
=
malloc
(
sizeof
(
"title "
)
+
5
);
if
(
!
val
.
psz_string
)
return
;
var_Change
(
p_input
,
"title"
,
VLC_VAR_CLEARCHOICES
,
NULL
,
NULL
);
var_Change
(
p_input
,
"title"
,
VLC_VAR_CLEARCHOICES
,
NULL
,
NULL
);
for
(
i
=
0
;
i
<
p_input
->
p
->
i_title
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
p_input
->
p
->
i_title
;
i
++
)
{
{
vlc_value_t
val2
,
text2
;
vlc_value_t
val2
,
text2
;
int
j
;
char
title
[
sizeof
(
"title "
)
+
3
*
sizeof
(
int
)]
;
/* Add Navigation entries */
/* Add Navigation entries */
sprintf
(
val
.
psz_string
,
"title %2i
"
,
i
);
sprintf
(
title
,
"title %2u
"
,
i
);
var_Destroy
(
p_input
,
val
.
psz_string
);
var_Destroy
(
p_input
,
title
);
var_Create
(
p_input
,
val
.
psz_string
,
var_Create
(
p_input
,
title
,
VLC_VAR_INTEGER
|
VLC_VAR_HASCHOICE
|
VLC_VAR_ISCOMMAND
);
VLC_VAR_INTEGER
|
VLC_VAR_HASCHOICE
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_input
,
val
.
psz_string
,
var_AddCallback
(
p_input
,
title
,
NavigationCallback
,
(
void
*
)(
intptr_t
)
i
);
NavigationCallback
,
(
void
*
)(
intptr_t
)
i
);
char
psz_length
[
MSTRTIME_MAX_SIZE
+
sizeof
(
" []"
)];
char
psz_length
[
MSTRTIME_MAX_SIZE
+
sizeof
(
" []"
)];
...
@@ -322,7 +317,7 @@ void input_ControlVarNavigation( input_thread_t *p_input )
...
@@ -322,7 +317,7 @@ void input_ControlVarNavigation( input_thread_t *p_input )
free
(
text
.
psz_string
);
free
(
text
.
psz_string
);
for
(
j
=
0
;
j
<
p_input
->
p
->
title
[
i
]
->
i_seekpoint
;
j
++
)
for
(
int
j
=
0
;
j
<
p_input
->
p
->
title
[
i
]
->
i_seekpoint
;
j
++
)
{
{
val2
.
i_int
=
j
;
val2
.
i_int
=
j
;
...
@@ -340,13 +335,11 @@ void input_ControlVarNavigation( input_thread_t *p_input )
...
@@ -340,13 +335,11 @@ void input_ControlVarNavigation( input_thread_t *p_input )
strdup
(
p_input
->
p
->
title
[
i
]
->
seekpoint
[
j
]
->
psz_name
);
strdup
(
p_input
->
p
->
title
[
i
]
->
seekpoint
[
j
]
->
psz_name
);
}
}
var_Change
(
p_input
,
val
.
psz_string
,
VLC_VAR_ADDCHOICE
,
var_Change
(
p_input
,
title
,
VLC_VAR_ADDCHOICE
,
&
val2
,
&
text2
);
&
val2
,
&
text2
);
free
(
text2
.
psz_string
);
free
(
text2
.
psz_string
);
}
}
}
}
free
(
val
.
psz_string
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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