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
fba40f89
Commit
fba40f89
authored
Jun 20, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sap: remove useless destination socket address
parent
e5cadc53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
src/stream_output/sap.c
src/stream_output/sap.c
+13
-20
No files found.
src/stream_output/sap.c
View file @
fba40f89
...
...
@@ -44,9 +44,6 @@
struct
session_descriptor_t
{
struct
sockaddr_storage
addr
;
socklen_t
addrlen
;
bool
b_ssm
;
};
...
...
@@ -208,7 +205,7 @@ static void *RunThread (void *self)
* Add a SAP announce
*/
static
int
SAP_Add
(
sap_handler_t
*
p_sap
,
session_descriptor_t
*
p_session
,
const
char
*
sdp
)
const
char
*
sdp
,
const
char
*
dst
)
{
int
i
;
char
psz_addr
[
NI_MAXNUMERICHOST
];
...
...
@@ -220,18 +217,24 @@ static int SAP_Add (sap_handler_t *p_sap, session_descriptor_t *p_session,
struct
sockaddr_in
in
;
struct
sockaddr_in6
in6
;
}
addr
;
socklen_t
addrlen
;
socklen_t
addrlen
=
0
;
struct
addrinfo
*
res
;
if
(
vlc_getaddrinfo
(
dst
,
0
,
NULL
,
&
res
)
==
0
)
{
if
(
res
->
ai_addrlen
<=
sizeof
(
addr
))
memcpy
(
&
addr
,
res
->
ai_addr
,
res
->
ai_addrlen
);
addrlen
=
res
->
ai_addrlen
;
freeaddrinfo
(
res
);
}
addrlen
=
p_session
->
addrlen
;
if
((
addrlen
==
0
)
||
(
addrlen
>
sizeof
(
addr
)))
if
(
addrlen
==
0
||
addrlen
>
sizeof
(
addr
))
{
msg_Err
(
p_sap
,
"No/invalid address specified for SAP announce"
);
return
VLC_EGENERIC
;
}
/* Determine SAP multicast address automatically */
memcpy
(
&
addr
,
&
p_session
->
addr
,
addrlen
);
switch
(
addr
.
a
.
sa_family
)
{
#if defined (HAVE_INET_PTON) || defined (_WIN32)
...
...
@@ -483,16 +486,6 @@ sout_AnnounceRegisterSDP( vlc_object_t *obj, const char *psz_sdp,
if
(
!
p_session
)
return
NULL
;
/* GRUIK. We should not convert back-and-forth from string to numbers */
struct
addrinfo
*
res
;
if
(
vlc_getaddrinfo
(
psz_dst
,
0
,
NULL
,
&
res
)
==
0
)
{
if
(
res
->
ai_addrlen
<=
sizeof
(
p_session
->
addr
))
memcpy
(
&
p_session
->
addr
,
res
->
ai_addr
,
p_session
->
addrlen
=
res
->
ai_addrlen
);
freeaddrinfo
(
res
);
}
vlc_mutex_lock
(
&
sap_mutex
);
sap_handler_t
*
p_sap
=
libvlc_priv
(
obj
->
p_libvlc
)
->
p_sap
;
if
(
p_sap
==
NULL
)
...
...
@@ -509,7 +502,7 @@ sout_AnnounceRegisterSDP( vlc_object_t *obj, const char *psz_sdp,
goto
error
;
msg_Dbg
(
obj
,
"adding SAP session"
);
if
(
SAP_Add
(
p_sap
,
p_session
,
psz_sdp
))
if
(
SAP_Add
(
p_sap
,
p_session
,
psz_sdp
,
psz_dst
))
{
vlc_mutex_lock
(
&
sap_mutex
);
vlc_object_release
((
vlc_object_t
*
)
p_sap
);
...
...
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