Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
1df637dd
Commit
1df637dd
authored
Jun 25, 2003
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/stream_output/announce.c:
+ Fixed a multiline string. + Coding style fixes.
parent
209f2eaf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
109 deletions
+105
-109
src/stream_output/announce.c
src/stream_output/announce.c
+105
-109
No files found.
src/stream_output/announce.c
View file @
1df637dd
...
...
@@ -52,7 +52,6 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout ,
char
*
psz_name_arg
,
int
ip_version
,
char
*
psz_v6_scope
)
{
sap_session_t
*
p_new
;
/* The SAP structure */
module_t
*
p_network
;
/* Network module */
network_socket_t
socket_desc
;
/* Socket descriptor */
...
...
@@ -76,7 +75,7 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout ,
p_new
->
i_ip_version
=
ip_version
;
/* Only "6" triggers IPv6. IPv4 is default */
if
(
ip_version
!=
6
)
if
(
ip_version
!=
6
)
{
msg_Dbg
(
p_sout
,
"Creating IPv4 SAP socket"
);
...
...
@@ -104,7 +103,6 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout ,
msg_Warn
(
p_sout
,
"Unable to initialize SAP"
);
return
NULL
;
}
}
else
{
...
...
@@ -150,7 +148,6 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout ,
return
NULL
;
}
/* Free what we allocated */
if
(
sap_ipv6_addr
)
free
(
sap_ipv6_addr
);
}
...
...
@@ -166,7 +163,9 @@ sap_session_t * sout_SAPNew ( sout_instance_t *p_sout ,
void
sout_SAPDelete
(
sout_instance_t
*
p_sout
,
sap_session_t
*
p_this
)
{
if
(
close
(
p_this
->
socket
)
)
{
msg_Err
(
p_sout
,
"Unable to close SAP socket"
);
}
if
(
p_this
)
free
(
p_this
);
}
...
...
@@ -176,7 +175,6 @@ void sout_SAPDelete( sout_instance_t *p_sout , sap_session_t * p_this )
*****************************************************************************/
void
sout_SAPSend
(
sout_instance_t
*
p_sout
,
sap_session_t
*
p_this
)
{
char
*
sap_head
;
/* SAP header */
char
sap_msg
[
1000
];
/* SDP content */
char
*
sap_send
;
/* What we send */
...
...
@@ -215,54 +213,52 @@ void sout_SAPSend( sout_instance_t *p_sout, sap_session_t * p_this)
/* Create the SDP content */
/* Do not add spaces at beginning of the lines ! */
sprintf
(
sap_msg
,
"v=0
\n
\
o=VideoLAN 3247692199 3247895918 IN IP4 VideoLAN
\n
\
s=%s
\n
\
u=VideoLAN
\n
\
t=0 0
\n
\
m=audio %s udp 14
\n
\
c=IN IP4 %s/15
\n
\
a=type:test
\n
"
,
p_this
->
psz_name
,
p_this
->
psz_port
,
p_this
->
psz_url
);
sprintf
(
sap_msg
,
"v=0
\n
"
"o=VideoLAN 3247692199 3247895918 IN IP4 VideoLAN
\n
"
"s=%s
\n
"
"u=VideoLAN
\n
"
"t=0 0
\n
"
"m=audio %s udp 14
\n
"
"c=IN IP4 %s/15
\n
"
"a=type:test
\n
"
,
p_this
->
psz_name
,
p_this
->
psz_port
,
p_this
->
psz_url
);
i_msg_size
=
strlen
(
sap_msg
);
i_size
=
i_msg_size
+
i_header_size
;
/* Create the message */
sap_send
=
(
char
*
)
malloc
(
i_size
*
sizeof
(
char
)
);
if
(
!
sap_send
)
if
(
!
sap_send
)
{
msg_Err
(
p_sout
,
"No memory left"
)
;
return
;
}
for
(
i
=
0
;
i
<
i_header_size
;
i
++
)
for
(
i
=
0
;
i
<
i_header_size
;
i
++
)
{
sap_send
[
i
]
=
sap_head
[
i
];
}
for
(
;
i
<
i_size
;
i
++
)
for
(
;
i
<
i_size
;
i
++
)
{
sap_send
[
i
]
=
sap_msg
[
i
-
i_header_size
];
}
if
(
i_size
<
1024
)
/* We mustn't send packets larger than 1024B */
if
(
i_size
<
1024
)
/* We mustn't send packets larger than 1024B */
{
if
(
p_this
->
i_ip_version
==
6
)
{
i_send_result
=
send
(
p_this
->
socket
,
sap_send
,
i_size
,
0
);
i_send_result
=
send
(
p_this
->
socket
,
sap_send
,
i_size
,
0
);
}
else
{
i_send_result
=
send
(
p_this
->
socket
,
sap_send
,
i_size
,
0
);
i_send_result
=
send
(
p_this
->
socket
,
sap_send
,
i_size
,
0
);
}
}
if
(
i_send_result
==
-
1
)
if
(
i_send_result
==
-
1
)
{
msg_Warn
(
p_sout
,
"SAP Send failed on socket %i. "
,
p_this
->
socket
);
msg_Warn
(
p_sout
,
"SAP send failed on socket %i"
,
p_this
->
socket
);
perror
(
"sendto"
);
}
...
...
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