Changeset 6040c07a76129070860a65bb6b44ed9405e02175
- Timestamp:
- 03/28/07 18:23:40
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1175099020 +0000
- git-parent:
[e910ff15eb7c297d21f8ae7317e9ac80b5e8e375]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1175099020 +0000
- Message:
Limit RTCP sending to one every five seconds as per RFC3550
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0b879fd |
r6040c07 |
|
| 704 | 704 | |
|---|
| 705 | 705 | if ((p_thread->rtcp_handle != -1) && (p_pk->i_buffer >= 8)) |
|---|
| 706 | | { |
|---|
| 707 | | /* FIXME: this is a very incorrect simplistic RTCP timer */ |
|---|
| | 706 | { // 1.25% rate limit: |
|---|
| 708 | 707 | if ((rtcp_counter / 80) >= p_thread->rtcp_size) |
|---|
| 709 | 708 | { |
|---|
| … | … | |
| 799 | 798 | SetWBE (ptr + 2, 6); /* length = 6 (7 double words) */ |
|---|
| 800 | 799 | SetDWBE (ptr + 4, p_sys->i_ssrc); |
|---|
| | 800 | SetQWBE (ptr + 8, NTPtime64 ()); |
|---|
| 801 | 801 | ptr += 28; |
|---|
| 802 | | /* timestamps and counter are handled later */ |
|---|
| | 802 | /* timestamp and counter are handled later */ |
|---|
| 803 | 803 | |
|---|
| 804 | 804 | /* Source description */ |
|---|
| … | … | |
| 851 | 851 | { |
|---|
| 852 | 852 | uint8_t *ptr = obj->rtcp_data; |
|---|
| 853 | | SetQWBE (ptr + 8, NTPtime64 ()); |
|---|
| | 853 | |
|---|
| | 854 | uint32_t last = GetDWBE (ptr + 8); // last RTCP SR send time |
|---|
| | 855 | uint64_t now64 = NTPtime64 (); |
|---|
| | 856 | if ((now64 >> 32) < (last + 5)) |
|---|
| | 857 | return; // no more than one SR every 5 seconds |
|---|
| | 858 | |
|---|
| | 859 | SetQWBE (ptr + 8, now64); |
|---|
| 854 | 860 | SetDWBE (ptr + 16, timestamp); |
|---|
| 855 | 861 | SetDWBE (ptr + 20, obj->sent_pkts); |
|---|