Ignore:
Timestamp:
Jan 20, 2007 5:18:14 AM (14 years ago)
Author:
bennylp
Message:

Implement ticket #56: Periodically transmit RTP packet on silence, to maintain NAT binding etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/silencedet.c

    r838 r888  
    143143        min_signal = sd->ptime; 
    144144    if (recalc_time < 0) 
    145         recalc_time = 5000; 
     145        recalc_time = 2000; 
    146146 
    147147    sd->min_signal_cnt = min_signal / sd->ptime; 
     
    257257            /* Adjust according to signal/silence proportions. */ 
    258258            if (pct_signal > 95) { 
    259                 new_threshold += (sd->weakest_signal - sd->cur_threshold)/4; 
     259                new_threshold += (sd->weakest_signal+1 - sd->cur_threshold)/2; 
    260260            } else if (pct_signal < 5) { 
    261261                new_threshold = (sd->cur_threshold+sd->loudest_silence)/2+1; 
    262             } else if (pct_signal > 90) { 
     262            } else if (pct_signal > 80) { 
    263263                new_threshold++; 
    264264            } else if (pct_signal < 10) { 
     
    269269 
    270270            if (updated && sd->cur_threshold != new_threshold) { 
     271                PJ_LOG(5,(sd->objname,  
     272                          "Vad cur_threshold updated %d-->%d. " 
     273                          "Signal lo=%d", 
     274                          sd->cur_threshold, new_threshold, 
     275                          sd->weakest_signal)); 
    271276                sd->cur_threshold = new_threshold; 
    272                 PJ_LOG(5,(sd->objname, "Vad cur_threshold updated to %d", 
    273                           sd->cur_threshold)); 
    274277            } 
    275278        } 
Note: See TracChangeset for help on using the changeset viewer.