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
6040c07a
Commit
6040c07a
authored
Mar 28, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit RTCP sending to one every five seconds as per RFC3550
parent
e910ff15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
modules/access_output/udp.c
modules/access_output/udp.c
+10
-4
No files found.
modules/access_output/udp.c
View file @
6040c07a
...
@@ -703,8 +703,7 @@ static void ThreadWrite( vlc_object_t *p_this )
...
@@ -703,8 +703,7 @@ static void ThreadWrite( vlc_object_t *p_this )
#endif
#endif
if
((
p_thread
->
rtcp_handle
!=
-
1
)
&&
(
p_pk
->
i_buffer
>=
8
))
if
((
p_thread
->
rtcp_handle
!=
-
1
)
&&
(
p_pk
->
i_buffer
>=
8
))
{
{
// 1.25% rate limit:
/* FIXME: this is a very incorrect simplistic RTCP timer */
if
((
rtcp_counter
/
80
)
>=
p_thread
->
rtcp_size
)
if
((
rtcp_counter
/
80
)
>=
p_thread
->
rtcp_size
)
{
{
SendRTCP
(
p_thread
,
GetDWBE
(
p_pk
->
p_buffer
+
4
));
SendRTCP
(
p_thread
,
GetDWBE
(
p_pk
->
p_buffer
+
4
));
...
@@ -798,8 +797,9 @@ static int OpenRTCP (sout_access_out_t *obj, int proto, uint16_t dport)
...
@@ -798,8 +797,9 @@ static int OpenRTCP (sout_access_out_t *obj, int proto, uint16_t dport)
ptr
[
1
]
=
200
;
/* payload type: Sender Report */
ptr
[
1
]
=
200
;
/* payload type: Sender Report */
SetWBE
(
ptr
+
2
,
6
);
/* length = 6 (7 double words) */
SetWBE
(
ptr
+
2
,
6
);
/* length = 6 (7 double words) */
SetDWBE
(
ptr
+
4
,
p_sys
->
i_ssrc
);
SetDWBE
(
ptr
+
4
,
p_sys
->
i_ssrc
);
SetQWBE
(
ptr
+
8
,
NTPtime64
());
ptr
+=
28
;
ptr
+=
28
;
/* timestamp
s
and counter are handled later */
/* timestamp and counter are handled later */
/* Source description */
/* Source description */
uint8_t
*
sdes
=
ptr
;
uint8_t
*
sdes
=
ptr
;
...
@@ -850,7 +850,13 @@ static void CloseRTCP (sout_access_thread_t *obj)
...
@@ -850,7 +850,13 @@ static void CloseRTCP (sout_access_thread_t *obj)
static
void
SendRTCP
(
sout_access_thread_t
*
obj
,
uint32_t
timestamp
)
static
void
SendRTCP
(
sout_access_thread_t
*
obj
,
uint32_t
timestamp
)
{
{
uint8_t
*
ptr
=
obj
->
rtcp_data
;
uint8_t
*
ptr
=
obj
->
rtcp_data
;
SetQWBE
(
ptr
+
8
,
NTPtime64
());
uint32_t
last
=
GetDWBE
(
ptr
+
8
);
// last RTCP SR send time
uint64_t
now64
=
NTPtime64
();
if
((
now64
>>
32
)
<
(
last
+
5
))
return
;
// no more than one SR every 5 seconds
SetQWBE
(
ptr
+
8
,
now64
);
SetDWBE
(
ptr
+
16
,
timestamp
);
SetDWBE
(
ptr
+
16
,
timestamp
);
SetDWBE
(
ptr
+
20
,
obj
->
sent_pkts
);
SetDWBE
(
ptr
+
20
,
obj
->
sent_pkts
);
SetDWBE
(
ptr
+
24
,
obj
->
sent_bytes
);
SetDWBE
(
ptr
+
24
,
obj
->
sent_bytes
);
...
...
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