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
b43a83e5
Commit
b43a83e5
authored
Dec 02, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua_variables: call only one time var_Type and corretly check the variable class.
parent
30dd89c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
modules/misc/lua/libs/variables.c
modules/misc/lua/libs/variables.c
+4
-2
No files found.
modules/misc/lua/libs/variables.c
View file @
b43a83e5
...
...
@@ -343,8 +343,10 @@ static int vlclua_add_callback( lua_State *L )
if
(
!
pp_obj
||
!*
pp_obj
)
return
vlclua_error
(
L
);
int
i_type
=
var_Type
(
*
pp_obj
,
psz_var
);
/* Check variable type, in order to avoid PANIC */
switch
(
var_Type
(
*
pp_obj
,
psz_var
)
)
switch
(
i_type
&
VLC_VAR_CLASS
)
{
case
VLC_VAR_BOOL
:
case
VLC_VAR_INTEGER
:
...
...
@@ -415,7 +417,7 @@ static int vlclua_add_callback( lua_State *L )
/* Do not move this before the lua specific code (it somehow changes
* the function in the stack to nil) */
p_callback
->
i_index
=
i_index
;
p_callback
->
i_type
=
var_Type
(
*
pp_obj
,
psz_var
)
;
p_callback
->
i_type
=
i_type
;
p_callback
->
L
=
lua_newthread
(
L
);
/* Do we have to keep a reference to this thread somewhere to prevent garbage collection? */
var_AddCallback
(
*
pp_obj
,
psz_var
,
vlclua_callback
,
p_callback
);
...
...
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