Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
9ebe8e38
Commit
9ebe8e38
authored
May 31, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kludge to remove square brackets and scopes from addresses in SAP announces
parent
c903b7db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
src/stream_output/sap.c
src/stream_output/sap.c
+25
-4
No files found.
src/stream_output/sap.c
View file @
9ebe8e38
...
...
@@ -277,7 +277,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
if
(
p_method
->
psz_address
==
NULL
)
{
/* Determine SAP multicast address automatically */
char
psz_buf
[
NI_MAXHOST
];
char
psz_buf
[
NI_MAXHOST
]
,
*
ptr
;
const
char
*
psz_addr
;
struct
addrinfo
hints
,
*
res
;
...
...
@@ -308,6 +308,11 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
return
VLC_EGENERIC
;
}
/* Remove interface specification if present */
ptr
=
strchr
(
psz_buf
,
'%'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
if
(
strchr
(
psz_buf
,
':'
)
!=
NULL
)
{
b_ipv6
=
VLC_TRUE
;
...
...
@@ -580,13 +585,28 @@ static int SDPGenerate( sap_handler_t *p_sap, session_descriptor_t *p_session )
{
int64_t
i_sdp_id
=
mdate
();
int
i_sdp_version
=
1
+
p_sap
->
i_sessions
+
(
rand
()
&
0xfff
);
char
*
psz_group
,
*
psz_name
;
char
*
psz_group
,
*
psz_name
,
psz_uri
[
NI_MAXHOST
]
;
char
ipv
;
psz_group
=
convert_to_utf8
(
p_sap
,
p_session
->
psz_group
);
psz_name
=
convert_to_utf8
(
p_sap
,
p_session
->
psz_name
);
/* FIXME: really check that psz_uri is a real IP address
* FIXME: make a common function to obtain a canonical IP address */
ipv
=
(
strchr
(
p_session
->
psz_uri
,
':'
)
!=
NULL
)
?
'6'
:
'4'
;
if
(
*
p_session
->
psz_uri
==
'['
)
{
char
*
ptr
;
strncpy
(
psz_uri
,
p_session
->
psz_uri
+
1
,
sizeof
(
psz_uri
)
);
psz_uri
[
sizeof
(
psz_uri
)
-
1
]
=
'\0'
;
ptr
=
strchr
(
psz_uri
,
'%'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
ptr
=
strchr
(
psz_uri
,
']'
);
if
(
ptr
!=
NULL
)
*
ptr
=
'\0'
;
}
/* see the lists in modules/stream_out/rtp.c for compliance stuff */
p_session
->
psz_sdp
=
(
char
*
)
malloc
(
...
...
@@ -599,7 +619,7 @@ static int SDPGenerate( sap_handler_t *p_sap, session_descriptor_t *p_session )
"a=tool:"
PACKAGE_STRING
"
\r\n
"
"a=type:broadcast
\r\n
"
)
+
strlen
(
psz_name
)
+
strlen
(
p
_session
->
p
sz_uri
)
+
300
+
strlen
(
psz_uri
)
+
300
+
(
psz_group
?
strlen
(
psz_group
)
:
0
)
);
if
(
p_session
->
psz_sdp
==
NULL
||
psz_name
==
NULL
)
...
...
@@ -609,6 +629,7 @@ static int SDPGenerate( sap_handler_t *p_sap, session_descriptor_t *p_session )
FREE
(
psz_group
);
return
VLC_ENOMEM
;
}
sprintf
(
p_session
->
psz_sdp
,
"v=0
\r\n
"
"o=- "
I64Fd
" %d IN IP4 127.0.0.1
\r\n
"
...
...
@@ -620,7 +641,7 @@ static int SDPGenerate( sap_handler_t *p_sap, session_descriptor_t *p_session )
"a=type:broadcast
\r\n
"
,
i_sdp_id
,
i_sdp_version
,
psz_name
,
ipv
,
p
_session
->
p
sz_uri
,
p_session
->
i_ttl
,
psz_uri
,
p_session
->
i_ttl
,
p_session
->
i_port
,
p_session
->
i_payload
);
free
(
psz_name
);
...
...
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