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
da905f6e
Commit
da905f6e
authored
Nov 02, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua_sd: cosmetics.
parent
fdd7844c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
modules/misc/lua/services_discovery.c
modules/misc/lua/services_discovery.c
+11
-3
No files found.
modules/misc/lua/services_discovery.c
View file @
da905f6e
/*****************************************************************************
* services_discovery.c : Services discovery using lua scripts
*****************************************************************************
* Copyright (C) 20
09
VideoLAN and AUTHORS
* Copyright (C) 20
10
VideoLAN and AUTHORS
*
* Authors: Fabio Ritrovato <sephiroth87 at videolan dot org>
* Rémi Duraffort <ivoire at videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -43,7 +44,6 @@ static const char * const ppsz_sd_options[] = { "sd", "longname", NULL };
/*****************************************************************************
* Local structures
*****************************************************************************/
struct
services_discovery_sys_t
{
lua_State
*
L
;
...
...
@@ -246,7 +246,7 @@ static void* Run( void *data )
}
/*****************************************************************************
*
Search: search for items according to the given query
*
Control: services discrovery control
****************************************************************************/
static
int
Control
(
services_discovery_t
*
p_sd
,
int
i_command
,
va_list
args
)
{
...
...
@@ -275,6 +275,9 @@ static int Control( services_discovery_t *p_sd, int i_command, va_list args )
return
VLC_SUCCESS
;
}
/*****************************************************************************
* DoSearch: search for a given query
****************************************************************************/
static
int
DoSearch
(
services_discovery_t
*
p_sd
,
const
char
*
psz_query
)
{
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
...
...
@@ -311,12 +314,16 @@ static const char *const ppsz_capabilities[] = {
NULL
};
/*****************************************************************************
* FillDescriptor: call the descriptor function and fill the structure
****************************************************************************/
static
int
FillDescriptor
(
services_discovery_t
*
p_sd
,
services_discovery_descriptor_t
*
p_desc
)
{
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
int
i_ret
=
VLC_EGENERIC
;
/* Create a new lua thread */
lua_State
*
L
=
luaL_newstate
();
if
(
luaL_dofile
(
L
,
p_sys
->
psz_filename
)
)
{
...
...
@@ -351,6 +358,7 @@ static int FillDescriptor( services_discovery_t *p_sd,
p_desc
->
i_capabilities
=
0
;
if
(
lua_istable
(
L
,
-
1
)
)
{
/* List all table entries */
lua_pushnil
(
L
);
while
(
lua_next
(
L
,
-
2
)
!=
0
)
{
...
...
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