Changeset 6040c07a76129070860a65bb6b44ed9405e02175

Show
Ignore:
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
  • modules/access_output/udp.c

    r0b879fd r6040c07  
    704704 
    705705        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: 
    708707            if ((rtcp_counter / 80) >= p_thread->rtcp_size) 
    709708            { 
     
    799798    SetWBE (ptr + 2, 6); /* length = 6 (7 double words) */ 
    800799    SetDWBE (ptr + 4, p_sys->i_ssrc); 
     800    SetQWBE (ptr + 8, NTPtime64 ()); 
    801801    ptr += 28; 
    802     /* timestamps and counter are handled later */ 
     802    /* timestamp and counter are handled later */ 
    803803 
    804804    /* Source description */ 
     
    851851{ 
    852852    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); 
    854860    SetDWBE (ptr + 16, timestamp); 
    855861    SetDWBE (ptr + 20, obj->sent_pkts);