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
2f49119c
Commit
2f49119c
authored
May 26, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA: remove find_name() before something starts to use it
parent
26a440b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
60 deletions
+1
-60
modules/lua/libs/objects.c
modules/lua/libs/objects.c
+0
-50
share/lua/README.txt
share/lua/README.txt
+1
-10
No files found.
modules/lua/libs/objects.c
View file @
2f49119c
...
...
@@ -82,61 +82,12 @@ int vlclua_gc_release( lua_State *L )
return
0
;
}
static
int
vlc_object_search_mode_from_string
(
const
char
*
psz_name
)
{
static
const
struct
{
int
i_mode
;
const
char
*
psz_name
;
}
pp_modes
[]
=
{
{
FIND_CHILD
,
"child"
},
{
FIND_ANYWHERE
,
"anywhere"
},
{
0
,
""
}
};
int
i
;
for
(
i
=
0
;
pp_modes
[
i
].
i_mode
;
i
++
)
{
if
(
!
strcmp
(
psz_name
,
pp_modes
[
i
].
psz_name
)
)
return
pp_modes
[
i
].
i_mode
;
}
return
0
;
}
static
int
vlclua_object_find
(
lua_State
*
L
)
{
lua_pushnil
(
L
);
return
1
;
}
static
int
vlclua_object_find_name
(
lua_State
*
L
)
{
const
char
*
psz_name
=
luaL_checkstring
(
L
,
2
);
const
char
*
psz_mode
=
luaL_checkstring
(
L
,
3
);
vlc_object_t
*
p_this
;
int
i_mode
=
vlc_object_search_mode_from_string
(
psz_mode
);
vlc_object_t
*
p_result
;
if
(
!
i_mode
)
return
luaL_error
(
L
,
"
\"
%s
\"
is not a valid search mode."
,
psz_mode
);
if
(
lua_type
(
L
,
1
)
==
LUA_TNIL
)
p_this
=
vlclua_get_this
(
L
);
else
{
vlc_object_t
**
p_obj
=
luaL_checkudata
(
L
,
1
,
"vlc_object"
);
p_this
=
*
p_obj
;
}
p_result
=
vlc_object_find_name
(
p_this
,
psz_name
,
i_mode
);
if
(
!
p_result
)
lua_pushnil
(
L
);
else
vlclua_push_vlc_object
(
L
,
p_result
,
vlclua_gc_release
);
return
1
;
}
static
int
vlclua_get_libvlc
(
lua_State
*
L
)
{
vlclua_push_vlc_object
(
L
,
vlclua_get_this
(
L
)
->
p_libvlc
,
...
...
@@ -175,7 +126,6 @@ static const luaL_Reg vlclua_object_reg[] = {
{
"playlist"
,
vlclua_get_playlist
},
{
"libvlc"
,
vlclua_get_libvlc
},
{
"find"
,
vlclua_object_find
},
{
"find_name"
,
vlclua_object_find_name
},
{
NULL
,
NULL
}
};
...
...
share/lua/README.txt
View file @
2f49119c
...
...
@@ -222,16 +222,7 @@ object.input(): Get the current input object.
object.playlist(): Get the playlist object.
object.libvlc(): Get the libvlc object.
object.find( object, type, mode ): Find an object of given type. mode can
be "child" and "anywhere". If set to "child" it will look in "object"'s
children. If set to "anywhere", it will look in all the objects. If
object is unset, the current module's object will be used.
Type can be: "libvlc", "playlist", "input", "decoder",
"vout", "aout", "packetizer", "generic".
This function is deprecated and slow and should be avoided.
object.find_name( object, name, mode ): Same as above except that it matches
on the object's name and not type. This function is also slow and should
be avoided if possible.
object.find( object, type, mode ): Return nil. DO NOT USE.
OSD
---
...
...
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