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
7d0d58d2
Commit
7d0d58d2
authored
Dec 07, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport 13614
parent
0971f005
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
33 deletions
+39
-33
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+39
-33
No files found.
modules/services_discovery/sap.c
View file @
7d0d58d2
...
...
@@ -279,7 +279,6 @@ static int Open( vlc_object_t *p_this )
malloc
(
sizeof
(
services_discovery_sys_t
)
);
playlist_view_t
*
p_view
;
char
*
psz_addr
;
vlc_value_t
val
;
p_sys
->
i_timeout
=
var_CreateGetInteger
(
p_sd
,
"sap-timeout"
);
...
...
@@ -298,37 +297,6 @@ static int Open( vlc_object_t *p_this )
CacheLoad
(
p_sd
);
}
if
(
var_CreateGetInteger
(
p_sd
,
"sap-ipv4"
)
)
{
InitSocket
(
p_sd
,
SAP_V4_GLOBAL_ADDRESS
,
SAP_PORT
);
InitSocket
(
p_sd
,
SAP_V4_ORG_ADDRESS
,
SAP_PORT
);
InitSocket
(
p_sd
,
SAP_V4_LOCAL_ADDRESS
,
SAP_PORT
);
InitSocket
(
p_sd
,
SAP_V4_LINK_ADDRESS
,
SAP_PORT
);
}
if
(
var_CreateGetInteger
(
p_sd
,
"sap-ipv6"
)
)
{
char
psz_address
[]
=
SAP_V6_1
"0"
SAP_V6_2
;
const
char
*
c_scope
;
for
(
c_scope
=
ipv6_scopes
;
*
c_scope
;
c_scope
++
)
{
psz_address
[
sizeof
(
SAP_V6_1
)
-
1
]
=
*
c_scope
;
InitSocket
(
p_sd
,
psz_address
,
SAP_PORT
);
}
}
psz_addr
=
var_CreateGetString
(
p_sd
,
"sap-addr"
);
if
(
psz_addr
&&
*
psz_addr
)
{
InitSocket
(
p_sd
,
psz_addr
,
SAP_PORT
);
}
if
(
p_sys
->
i_fd
==
0
)
{
msg_Err
(
p_sd
,
"unable to read on any address"
);
return
VLC_EGENERIC
;
}
/* Cache sap_timeshift value */
p_sys
->
b_timeshift
=
var_CreateGetInteger
(
p_sd
,
"sap-timeshift"
)
?
VLC_TRUE
:
VLC_FALSE
;
...
...
@@ -507,8 +475,46 @@ static void CloseDemux( vlc_object_t *p_this )
static
void
Run
(
services_discovery_t
*
p_sd
)
{
char
*
psz_addr
;
int
i
;
/* Braindead Winsock DNS resolver will get stuck over 2 seconds per failed
* DNS queries, even if the DNS server returns an error with milliseconds.
* You don't want to know why the bug (as of XP SP2) wasn't fixed since
* Winsock 1.1 from Windows 95, if not Windows 3.1.
* Anyway, to avoid a 30 seconds delay for failed IPv6 socket creation,
* we have to open sockets in Run() rather than Open(). */
if
(
var_CreateGetInteger
(
p_sd
,
"sap-ipv4"
)
)
{
InitSocket
(
p_sd
,
SAP_V4_GLOBAL_ADDRESS
,
SAP_PORT
);
InitSocket
(
p_sd
,
SAP_V4_ORG_ADDRESS
,
SAP_PORT
);
InitSocket
(
p_sd
,
SAP_V4_LOCAL_ADDRESS
,
SAP_PORT
);
InitSocket
(
p_sd
,
SAP_V4_LINK_ADDRESS
,
SAP_PORT
);
}
if
(
var_CreateGetInteger
(
p_sd
,
"sap-ipv6"
)
)
{
char
psz_address
[]
=
SAP_V6_1
"0"
SAP_V6_2
;
const
char
*
c_scope
;
for
(
c_scope
=
ipv6_scopes
;
*
c_scope
;
c_scope
++
)
{
psz_address
[
sizeof
(
SAP_V6_1
)
-
1
]
=
*
c_scope
;
InitSocket
(
p_sd
,
psz_address
,
SAP_PORT
);
}
}
psz_addr
=
var_CreateGetString
(
p_sd
,
"sap-addr"
);
if
(
psz_addr
&&
*
psz_addr
)
{
InitSocket
(
p_sd
,
psz_addr
,
SAP_PORT
);
}
if
(
p_sd
->
p_sys
->
i_fd
==
0
)
{
msg_Err
(
p_sd
,
"unable to listen on any address"
);
return
;
}
/* read SAP packets */
while
(
!
p_sd
->
b_die
)
{
...
...
@@ -1232,7 +1238,7 @@ static sdp_t * ParseSDP( vlc_object_t *p_obj, char* psz_sdp )
static
int
InitSocket
(
services_discovery_t
*
p_sd
,
char
*
psz_address
,
int
i_port
)
{
int
i_fd
=
net_OpenUDP
(
p_sd
,
psz_address
,
i_port
,
""
,
0
);
int
i_fd
=
net_OpenUDP
(
p_sd
,
psz_address
,
i_port
,
NULL
,
0
);
if
(
i_fd
!=
-
1
)
{
...
...
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