Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
42285370
Commit
42285370
authored
Jan 24, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA interface: correct/simplify error handling
parent
9cfa2690
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
28 deletions
+19
-28
modules/misc/lua/intf.c
modules/misc/lua/intf.c
+19
-28
No files found.
modules/misc/lua/intf.c
View file @
42285370
...
@@ -184,9 +184,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
...
@@ -184,9 +184,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
{
{
msg_Err
(
p_intf
,
"Couldn't find lua interface script
\"
%s
\"
."
,
msg_Err
(
p_intf
,
"Couldn't find lua interface script
\"
%s
\"
."
,
psz_name
);
psz_name
);
free
(
psz_name
);
goto
error
;
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
msg_Dbg
(
p_intf
,
"Found lua interface script: %s"
,
p_sys
->
psz_filename
);
msg_Dbg
(
p_intf
,
"Found lua interface script: %s"
,
p_sys
->
psz_filename
);
...
@@ -194,10 +192,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
...
@@ -194,10 +192,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
if
(
!
L
)
if
(
!
L
)
{
{
msg_Err
(
p_intf
,
"Could not create new Lua State"
);
msg_Err
(
p_intf
,
"Could not create new Lua State"
);
free
(
p_sys
->
psz_filename
);
goto
error
;
free
(
psz_name
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
luaL_openlibs
(
L
);
luaL_openlibs
(
L
);
...
@@ -244,19 +239,13 @@ int Open_LuaIntf( vlc_object_t *p_this )
...
@@ -244,19 +239,13 @@ int Open_LuaIntf( vlc_object_t *p_this )
"package.path = [[%s"
DIR_SEP
"modules"
DIR_SEP
"?.lua;]]..package.path"
,
"package.path = [[%s"
DIR_SEP
"modules"
DIR_SEP
"?.lua;]]..package.path"
,
p_sys
->
psz_filename
)
<
0
)
p_sys
->
psz_filename
)
<
0
)
{
{
free
(
p_sys
->
psz_filename
);
goto
error
;
free
(
psz_name
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
*
psz_char
=
DIR_SEP_CHAR
;
*
psz_char
=
DIR_SEP_CHAR
;
if
(
luaL_dostring
(
L
,
psz_command
)
)
if
(
luaL_dostring
(
L
,
psz_command
)
)
{
{
free
(
psz_command
);
free
(
psz_command
);
free
(
p_sys
->
psz_filename
);
goto
error
;
free
(
psz_name
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
free
(
psz_command
);
free
(
psz_command
);
}
}
...
@@ -303,12 +292,19 @@ int Open_LuaIntf( vlc_object_t *p_this )
...
@@ -303,12 +292,19 @@ int Open_LuaIntf( vlc_object_t *p_this )
if
(
vlc_clone
(
&
p_sys
->
thread
,
Run
,
p_intf
,
VLC_THREAD_PRIORITY_LOW
)
)
if
(
vlc_clone
(
&
p_sys
->
thread
,
Run
,
p_intf
,
VLC_THREAD_PRIORITY_LOW
)
)
{
{
p_sys
->
exiting
=
true
;
p_intf
->
psz_header
=
NULL
;
Close_LuaIntf
(
p_this
);
vlc_cond_destroy
(
&
p_sys
->
wait
);
return
VLC_ENOMEM
;
vlc_mutex_destroy
(
&
p_sys
->
lock
);
lua_close
(
p_sys
->
L
);
goto
error
;
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
error:
free
(
p_sys
->
psz_filename
);
free
(
p_sys
);
free
(
psz_name
);
return
VLC_EGENERIC
;
}
}
void
Close_LuaIntf
(
vlc_object_t
*
p_this
)
void
Close_LuaIntf
(
vlc_object_t
*
p_this
)
...
@@ -316,16 +312,11 @@ void Close_LuaIntf( vlc_object_t *p_this )
...
@@ -316,16 +312,11 @@ void Close_LuaIntf( vlc_object_t *p_this )
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
;
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
;
vlc_cancel
(
p_sys
->
thread
);
if
(
!
p_sys
->
exiting
)
/* <- Read-only here and in thread: no locking */
{
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
exiting
=
true
;
p_sys
->
exiting
=
true
;
vlc_cond_signal
(
&
p_sys
->
wait
);
vlc_cond_signal
(
&
p_sys
->
wait
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_join
(
p_sys
->
thread
,
NULL
);
vlc_join
(
p_sys
->
thread
,
NULL
);
}
vlc_cond_destroy
(
&
p_sys
->
wait
);
vlc_cond_destroy
(
&
p_sys
->
wait
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
...
...
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