Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
fe30f8c0
Commit
fe30f8c0
authored
11 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Lua: add sockets to extensions (fixes
#9495
)
parent
bfe17fd3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
modules/lua/extension.c
+13
-1
13 additions, 1 deletion
modules/lua/extension.c
modules/lua/extension.h
+2
-0
2 additions, 0 deletions
modules/lua/extension.h
modules/lua/extension_thread.c
+1
-0
1 addition, 0 deletions
modules/lua/extension_thread.c
share/lua/README.txt
+1
-1
1 addition, 1 deletion
share/lua/README.txt
with
17 additions
and
2 deletions
modules/lua/extension.c
+
13
−
1
View file @
fe30f8c0
...
...
@@ -650,6 +650,8 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
if
(
!
p_ext
->
p_sys
->
L
)
return
VLC_SUCCESS
;
vlclua_fd_interrupt
(
&
p_ext
->
p_sys
->
dtable
);
// Unset and release input objects
if
(
p_ext
->
p_sys
->
p_input
)
{
...
...
@@ -666,6 +668,7 @@ int lua_ExtensionDeactivate( extensions_manager_t *p_mgr, extension_t *p_ext )
int
i_ret
=
lua_ExecuteFunction
(
p_mgr
,
p_ext
,
"deactivate"
,
LUA_END
);
/* Clear Lua State */
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
p_ext
->
p_sys
->
L
);
p_ext
->
p_sys
->
L
=
NULL
;
...
...
@@ -824,7 +827,11 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
luaopen_dialog
(
L
,
p_ext
);
luaopen_input
(
L
);
luaopen_msg
(
L
);
luaopen_net_generic
(
L
);
if
(
vlclua_fd_init
(
L
,
&
p_ext
->
p_sys
->
dtable
)
)
{
lua_close
(
L
);
return
NULL
;
}
luaopen_object
(
L
);
luaopen_osd
(
L
);
luaopen_playlist
(
L
);
...
...
@@ -859,6 +866,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
{
msg_Warn
(
p_mgr
,
"Error while setting the module "
"search path for %s"
,
p_ext
->
psz_name
);
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
L
);
return
NULL
;
}
...
...
@@ -868,6 +876,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
{
msg_Warn
(
p_mgr
,
"Error loading script %s: %s"
,
p_ext
->
psz_name
,
lua_tostring
(
L
,
lua_gettop
(
L
)
)
);
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
L
);
return
NULL
;
}
...
...
@@ -1044,7 +1053,10 @@ static int TriggerExtension( extensions_manager_t *p_mgr,
/* Close lua state for trigger-only extensions */
if
(
p_ext
->
p_sys
->
L
)
{
vlclua_fd_cleanup
(
&
p_ext
->
p_sys
->
dtable
);
lua_close
(
p_ext
->
p_sys
->
L
);
}
p_ext
->
p_sys
->
L
=
NULL
;
return
i_ret
;
...
...
This diff is collapsed.
Click to expand it.
modules/lua/extension.h
+
2
−
0
View file @
fe30f8c0
...
...
@@ -69,6 +69,8 @@ struct extension_sys_t
/* Lua specific */
lua_State
*
L
;
vlclua_dtable_t
dtable
;
/* Thread data */
vlc_thread_t
thread
;
vlc_mutex_t
command_lock
;
...
...
This diff is collapsed.
Click to expand it.
modules/lua/extension_thread.c
+
1
−
0
View file @
fe30f8c0
...
...
@@ -28,6 +28,7 @@
/* I don't want to include lua headers here */
typedef
struct
lua_State
lua_State
;
#include
"vlc.h"
#include
"extension.h"
#include
"assert.h"
...
...
This diff is collapsed.
Click to expand it.
share/lua/README.txt
+
1
−
1
View file @
fe30f8c0
...
...
@@ -160,7 +160,7 @@ misc.quit(): Quit VLC.
Net
---
----------------------------------------------------------------
/!\ NB: this namespace is ONLY usable for interfaces.
/!\ NB: this namespace is ONLY usable for interfaces
and extensions
.
---
----------------------------------------------------------------
net.url_parse( url, [option delimiter] ): Parse URL. Returns a table with
...
...
This diff is collapsed.
Click to expand it.
Migration Bot
@MigrationBot
mentioned in issue
#9495 (closed)
·
4 years ago
mentioned in issue
#9495 (closed)
mentioned in issue #9495
Toggle commit list
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment