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
251d121b
Commit
251d121b
authored
Feb 14, 2010
by
Fabio Ritrovato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua SD: add modules path
parent
151825fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
modules/misc/lua/services_discovery.c
modules/misc/lua/services_discovery.c
+18
-12
No files found.
modules/misc/lua/services_discovery.c
View file @
251d121b
...
@@ -70,17 +70,14 @@ int Open_LuaSD( vlc_object_t *p_this )
...
@@ -70,17 +70,14 @@ int Open_LuaSD( vlc_object_t *p_this )
msg_Err
(
p_sd
,
"Couldn't find lua services discovery script
\"
%s
\"
."
,
msg_Err
(
p_sd
,
"Couldn't find lua services discovery script
\"
%s
\"
."
,
psz_name
);
psz_name
);
free
(
psz_name
);
free
(
psz_name
);
free
(
p_sys
);
goto
error
;
return
VLC_EGENERIC
;
}
}
free
(
psz_name
);
free
(
psz_name
);
L
=
luaL_newstate
();
L
=
luaL_newstate
();
if
(
!
L
)
if
(
!
L
)
{
{
msg_Err
(
p_sd
,
"Could not create new Lua State"
);
msg_Err
(
p_sd
,
"Could not create new Lua State"
);
free
(
p_sys
->
psz_filename
);
goto
error
;
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
luaL_openlibs
(
L
);
luaL_openlibs
(
L
);
luaL_register
(
L
,
"vlc"
,
p_reg
);
luaL_register
(
L
,
"vlc"
,
p_reg
);
...
@@ -99,24 +96,33 @@ int Open_LuaSD( vlc_object_t *p_this )
...
@@ -99,24 +96,33 @@ int Open_LuaSD( vlc_object_t *p_this )
luaopen_gettext
(
L
);
luaopen_gettext
(
L
);
luaopen_xml
(
L
);
luaopen_xml
(
L
);
lua_pop
(
L
,
1
);
lua_pop
(
L
,
1
);
if
(
vlclua_add_modules_path
(
p_sd
,
L
,
p_sys
->
psz_filename
)
)
{
msg_Warn
(
p_sd
,
"Error while setting the module search path for %s"
,
p_sys
->
psz_filename
);
lua_close
(
L
);
goto
error
;
}
if
(
luaL_dofile
(
L
,
p_sys
->
psz_filename
)
)
if
(
luaL_dofile
(
L
,
p_sys
->
psz_filename
)
)
{
{
msg_Err
(
p_sd
,
"Error loading script %s: %s"
,
p_sys
->
psz_filename
,
msg_Err
(
p_sd
,
"Error loading script %s: %s"
,
p_sys
->
psz_filename
,
lua_tostring
(
L
,
lua_gettop
(
L
)
)
);
lua_tostring
(
L
,
lua_gettop
(
L
)
)
);
lua_pop
(
L
,
1
);
lua_pop
(
L
,
1
);
free
(
p_sys
->
psz_filename
);
lua_close
(
L
);
free
(
p_sys
);
goto
error
;
return
VLC_EGENERIC
;
}
}
p_sys
->
L
=
L
;
p_sys
->
L
=
L
;
if
(
vlc_clone
(
&
p_sd
->
p_sys
->
thread
,
Run
,
p_sd
,
VLC_THREAD_PRIORITY_LOW
)
)
if
(
vlc_clone
(
&
p_sd
->
p_sys
->
thread
,
Run
,
p_sd
,
VLC_THREAD_PRIORITY_LOW
)
)
{
{
lua_close
(
L
);
goto
error
;
}
return
VLC_SUCCESS
;
error:
free
(
p_sys
->
psz_filename
);
free
(
p_sys
->
psz_filename
);
free
(
p_sys
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -150,6 +156,6 @@ static void* Run( void *data )
...
@@ -150,6 +156,6 @@ static void* Run( void *data )
lua_pop
(
L
,
1
);
lua_pop
(
L
,
1
);
return
NULL
;
return
NULL
;
}
}
//msg_Info
( p_sd, "LuaSD script loaded: %s", p_sd->psz_name );
msg_Dbg
(
p_sd
,
"LuaSD script loaded: %s"
,
p_sd
->
psz_name
);
return
NULL
;
return
NULL
;
}
}
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