Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
133d57fe
Commit
133d57fe
authored
Dec 03, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't write R/O memory + clean up
parent
fbf4c806
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
48 deletions
+51
-48
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+51
-48
No files found.
src/playlist/services_discovery.c
View file @
133d57fe
...
@@ -28,59 +28,62 @@ static void RunSD( services_discovery_t *p_sd );
...
@@ -28,59 +28,62 @@ static void RunSD( services_discovery_t *p_sd );
int
playlist_ServicesDiscoveryAdd
(
playlist_t
*
p_playlist
,
const
char
*
psz_modules
)
int
playlist_ServicesDiscoveryAdd
(
playlist_t
*
p_playlist
,
const
char
*
psz_modules
)
{
{
if
(
psz_modules
&&
*
psz_modules
)
const
char
*
psz_parser
=
psz_modules
?:
""
;
{
int
retval
=
VLC_SUCCESS
;
const
char
*
psz_parser
=
psz_modules
;
char
*
psz_next
;
while
(
psz_parser
&&
*
psz_parser
)
for
(;;
)
{
{
while
(
*
psz_parser
==
' '
||
*
psz_parser
==
':'
||
*
psz_parser
==
','
)
while
(
*
psz_parser
==
' '
||
*
psz_parser
==
':'
||
*
psz_parser
==
','
)
psz_parser
++
;
psz_parser
++
;
if
(
(
psz_next
=
strchr
(
psz_parser
,
':'
)
)
)
*
psz_next
++
=
'\0'
;
if
(
*
psz_parser
==
'\0'
)
if
(
*
psz_parser
==
'\0'
)
break
;
break
;
msg_Dbg
(
p_playlist
,
"Add services_discovery %s"
,
psz_parser
);
const
char
*
psz_next
=
strchr
(
psz_parser
,
':'
);
if
(
psz_next
==
NULL
)
psz_next
=
psz_parser
+
strlen
(
psz_parser
);
char
psz_plugin
[
psz_next
-
psz_parser
+
1
];
memcpy
(
psz_plugin
,
psz_parser
,
sizeof
(
psz_plugin
)
-
1
);
psz_plugin
[
sizeof
(
psz_plugin
)
-
1
]
=
'\0'
;
psz_parser
=
psz_next
;
/* Perform the addition */
/* Perform the addition */
{
msg_Dbg
(
p_playlist
,
"Add services_discovery %s"
,
psz_plugin
);
services_discovery_t
*
p_sd
=
vlc_object_create
(
p_playlist
,
services_discovery_t
*
p_sd
=
vlc_object_create
(
p_playlist
,
VLC_OBJECT_SD
);
VLC_OBJECT_SD
);
if
(
p_sd
==
NULL
)
return
VLC_ENOMEM
;
p_sd
->
pf_run
=
NULL
;
p_sd
->
pf_run
=
NULL
;
p_sd
->
p_module
=
module_Need
(
p_sd
,
"services_discovery"
,
psz_parser
,
0
);
p_sd
->
p_module
=
module_Need
(
p_sd
,
"services_discovery"
,
psz_plugin
,
0
);
if
(
p_sd
->
p_module
==
NULL
)
if
(
p_sd
->
p_module
==
NULL
)
{
{
msg_Err
(
p_playlist
,
"no suitable services discovery module"
);
msg_Err
(
p_playlist
,
"no suitable services discovery module"
);
vlc_object_destroy
(
p_sd
);
vlc_object_destroy
(
p_sd
);
return
VLC_EGENERIC
;
retval
=
VLC_EGENERIC
;
continue
;
}
}
p_sd
->
psz_module
=
strdup
(
psz_parser
);
p_sd
->
psz_module
=
strdup
(
psz_plugin
);
p_sd
->
b_die
=
VLC_FALSE
;
p_sd
->
b_die
=
VLC_FALSE
;
PL_LOCK
;
PL_LOCK
;
TAB_APPEND
(
p_playlist
->
i_sds
,
p_playlist
->
pp_sds
,
p_sd
);
TAB_APPEND
(
p_playlist
->
i_sds
,
p_playlist
->
pp_sds
,
p_sd
);
PL_UNLOCK
;
PL_UNLOCK
;
if
(
!
p_sd
->
pf_run
)
{
if
((
p_sd
->
pf_run
!=
NULL
)
psz_parser
=
psz_next
;
&&
vlc_thread_create
(
p_sd
,
"services_discovery"
,
RunSD
,
continue
;
VLC_THREAD_PRIORITY_LOW
,
VLC_FALSE
))
}
if
(
vlc_thread_create
(
p_sd
,
"services_discovery"
,
RunSD
,
VLC_THREAD_PRIORITY_LOW
,
VLC_FALSE
)
)
{
{
msg_Err
(
p_sd
,
"cannot create services discovery thread"
);
msg_Err
(
p_sd
,
"cannot create services discovery thread"
);
vlc_object_destroy
(
p_sd
);
vlc_object_destroy
(
p_sd
);
return
VLC_EGENERIC
;
retval
=
VLC_EGENERIC
;
}
continue
;
}
psz_parser
=
psz_next
;
}
}
}
}
return
VLC_SUCCESS
;
return
retval
;
}
}
int
playlist_ServicesDiscoveryRemove
(
playlist_t
*
p_playlist
,
int
playlist_ServicesDiscoveryRemove
(
playlist_t
*
p_playlist
,
...
...
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