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
b4f9defc
Commit
b4f9defc
authored
Aug 28, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPnP Intel: remove useless and harmful SD thread
parent
629f5752
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
50 deletions
+37
-50
modules/services_discovery/upnp_intel.cpp
modules/services_discovery/upnp_intel.cpp
+37
-50
No files found.
modules/services_discovery/upnp_intel.cpp
View file @
b4f9defc
...
...
@@ -66,16 +66,6 @@ vlc_module_end();
* Local prototypes
*****************************************************************************/
// VLC handle
struct
services_discovery_sys_t
{
playlist_t
*
p_playlist
;
playlist_item_t
*
p_node_cat
;
playlist_item_t
*
p_node_one
;
};
// Constants
const
char
*
MEDIA_SERVER_DEVICE_TYPE
=
"urn:schemas-upnp-org:device:MediaServer:1"
;
...
...
@@ -272,7 +262,6 @@ private:
// VLC callback prototypes
static
void
Run
(
services_discovery_t
*
p_sd
);
static
playlist_t
*
pl_Get
(
services_discovery_t
*
p_sd
)
{
return
p_sd
->
p_sys
->
p_playlist
;
...
...
@@ -286,6 +275,17 @@ const char* xml_getChildElementValue( IXML_Element* parent, const char* tagName
IXML_Document
*
parseBrowseResult
(
IXML_Document
*
doc
);
// VLC handle
struct
services_discovery_sys_t
{
playlist_t
*
p_playlist
;
playlist_item_t
*
p_node_cat
;
playlist_item_t
*
p_node_one
;
Cookie
cookie
;
};
// VLC callbacks...
static
int
Open
(
vlc_object_t
*
p_this
)
...
...
@@ -294,7 +294,6 @@ static int Open( vlc_object_t *p_this )
services_discovery_sys_t
*
p_sys
=
(
services_discovery_sys_t
*
)
malloc
(
sizeof
(
services_discovery_sys_t
)
);
p_sd
->
pf_run
=
Run
;
p_sd
->
p_sys
=
p_sys
;
p_sys
->
p_playlist
=
pl_Yield
(
p_sd
);
...
...
@@ -305,40 +304,17 @@ static int Open( vlc_object_t *p_this )
true
);
vlc_object_unlock
(
p_sys
->
p_playlist
);
return
VLC_SUCCESS
;
}
static
void
Close
(
vlc_object_t
*
p_this
)
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
p_this
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
p_sys
->
cookie
.
serviceDiscovery
=
p_sd
;
p_sys
->
cookie
.
serverList
=
new
MediaServerList
(
&
cookie
);
p_sys
->
cookie
.
lock
=
new
Lockable
();
vlc_object_lock
(
p_sys
->
p_playlist
);
playlist_NodeDelete
(
pl_Get
(
p_sd
),
p_sys
->
p_node_one
,
true
,
true
);
playlist_NodeDelete
(
pl_Get
(
p_sd
),
p_sys
->
p_node_cat
,
true
,
true
);
vlc_object_unlock
(
p_sys
->
p_playlist
);
pl_Release
(
p_sd
);
free
(
p_sys
);
}
static
void
Run
(
services_discovery_t
*
p_sd
)
{
int
res
;
res
=
UpnpInit
(
0
,
0
);
int
res
=
UpnpInit
(
0
,
0
);
if
(
res
!=
UPNP_E_SUCCESS
)
{
msg_Err
(
p_sd
,
"%s"
,
UpnpGetErrorMessage
(
res
)
);
retur
n
;
goto
shutDow
n
;
}
Cookie
cookie
;
cookie
.
serviceDiscovery
=
p_sd
;
cookie
.
serverList
=
new
MediaServerList
(
&
cookie
);
cookie
.
lock
=
new
Lockable
();
res
=
UpnpRegisterClient
(
Callback
,
&
cookie
,
&
cookie
.
clientHandle
);
if
(
res
!=
UPNP_E_SUCCESS
)
{
...
...
@@ -353,20 +329,31 @@ static void Run( services_discovery_t* p_sd )
goto
shutDown
;
}
msg_Dbg
(
p_sd
,
"UPnP discovery started"
);
while
(
vlc_object_alive
(
p_sd
)
)
{
msleep
(
500
);
}
msg_Dbg
(
p_sd
,
"UPnP discovery stopped"
);
return
VLC_SUCCESS
;
shutDown:
UpnpFinish
();
delete
cookie
.
serverList
;
delete
cookie
.
lock
;
Close
(
p_this
);
return
VLC_EGENERIC
;
}
static
void
Close
(
vlc_object_t
*
p_this
)
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
p_this
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
UpnpFinish
();
delete
p_sys
->
cookie
.
serverList
;
delete
p_sys
->
cookie
.
lock
;
vlc_object_lock
(
p_sys
->
p_playlist
);
playlist_NodeDelete
(
pl_Get
(
p_sd
),
p_sys
->
p_node_one
,
true
,
true
);
playlist_NodeDelete
(
pl_Get
(
p_sd
),
p_sys
->
p_node_cat
,
true
,
true
);
vlc_object_unlock
(
p_sys
->
p_playlist
);
pl_Release
(
p_sd
);
free
(
p_sys
);
}
// XML utility functions:
...
...
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