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
bb210fea
Commit
bb210fea
authored
Mar 29, 2017
by
Hugo Beauzée-Luyssen
Browse files
lua: Split CMD_DEACTIVATE generation/queuing out of Deactivate
parent
6a627ce8
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/lua/extension_thread.c
View file @
bb210fea
...
...
@@ -115,6 +115,27 @@ static void FreeCommands( struct command_t *command )
FreeCommands
(
next
);
}
static
bool
QueueDeactivateCommand
(
extension_t
*
p_ext
)
{
struct
command_t
*
cmd
=
calloc
(
1
,
sizeof
(
struct
command_t
)
);
if
(
unlikely
(
cmd
==
NULL
)
)
return
false
;
/* Free the list of commands */
if
(
p_ext
->
p_sys
->
command
)
FreeCommands
(
p_ext
->
p_sys
->
command
->
next
);
/* Push command */
cmd
->
i_command
=
CMD_DEACTIVATE
;
if
(
p_ext
->
p_sys
->
command
)
p_ext
->
p_sys
->
command
->
next
=
cmd
;
else
p_ext
->
p_sys
->
command
=
cmd
;
vlc_cond_signal
(
&
p_ext
->
p_sys
->
wait
);
return
true
;
}
/** Deactivate this extension: pushes immediate command and drops queued */
int
Deactivate
(
extensions_manager_t
*
p_mgr
,
extension_t
*
p_ext
)
{
...
...
@@ -136,22 +157,10 @@ int Deactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
return
VLC_SUCCESS
;
}
/* Free the list of commands */
if
(
p_ext
->
p_sys
->
command
)
FreeCommands
(
p_ext
->
p_sys
->
command
->
next
);
/* Push command */
struct
command_t
*
cmd
=
calloc
(
1
,
sizeof
(
struct
command_t
)
);
cmd
->
i_command
=
CMD_DEACTIVATE
;
if
(
p_ext
->
p_sys
->
command
)
p_ext
->
p_sys
->
command
->
next
=
cmd
;
else
p_ext
->
p_sys
->
command
=
cmd
;
vlc_cond_signal
(
&
p_ext
->
p_sys
->
wait
);
bool
b_success
=
QueueDeactivateCommand
(
p_ext
);
vlc_mutex_unlock
(
&
p_ext
->
p_sys
->
command_lock
);
return
VLC_SUCCESS
;
return
b_success
?
VLC_SUCCESS
:
VLC_ENOMEM
;
}
void
KillExtension
(
extensions_manager_t
*
p_mgr
,
extension_t
*
p_ext
)
...
...
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