Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
ce741080
Commit
ce741080
authored
Mar 28, 2017
by
Hugo Beauzée-Luyssen
Browse files
lua: PushCommand: Reduce locked scope
parent
ab515823
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/lua/extension_thread.c
View file @
ce741080
...
...
@@ -228,8 +228,6 @@ void KillExtension( extensions_manager_t *p_mgr, extension_t *p_ext )
int
PushCommand__
(
extension_t
*
p_ext
,
bool
b_unique
,
command_type_e
i_command
,
va_list
args
)
{
vlc_mutex_lock
(
&
p_ext
->
p_sys
->
command_lock
);
/* Create command */
struct
command_t
*
cmd
=
calloc
(
1
,
sizeof
(
struct
command_t
)
);
cmd
->
i_command
=
i_command
;
...
...
@@ -244,7 +242,6 @@ int PushCommand__( extension_t *p_ext, bool b_unique, command_type_e i_command,
if
(
!
pi
)
{
free
(
cmd
);
vlc_mutex_unlock
(
&
p_ext
->
p_sys
->
command_lock
);
return
VLC_ENOMEM
;
}
*
pi
=
va_arg
(
args
,
int
);
...
...
@@ -257,7 +254,6 @@ int PushCommand__( extension_t *p_ext, bool b_unique, command_type_e i_command,
if
(
!
pi
)
{
free
(
cmd
);
vlc_mutex_unlock
(
&
p_ext
->
p_sys
->
command_lock
);
return
VLC_ENOMEM
;
}
*
pi
=
va_arg
(
args
,
int
);
...
...
@@ -275,6 +271,8 @@ int PushCommand__( extension_t *p_ext, bool b_unique, command_type_e i_command,
break
;
}
vlc_mutex_lock
(
&
p_ext
->
p_sys
->
command_lock
);
/* Push command to the end of the queue */
struct
command_t
*
last
=
p_ext
->
p_sys
->
command
;
if
(
!
last
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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