some useless change

This commit is contained in:
root 2019-04-08 07:48:11 -04:00
parent f7c2d15adc
commit ecc90928d3
2 changed files with 6 additions and 2 deletions

View File

@ -117,8 +117,10 @@ int delay_manager_t::check()
if(!delay_mp.empty())
{
const double m=1000*1000;
double timer_value=delay_mp.begin()->first/m -get_current_time_us()/m; // be aware of negative value, and be aware of uint
if(timer_value<0) timer_value=0; // set it to 0 if negative, although libev support negative value
ev_timer_stop(loop, &timer);
ev_timer_set(&timer, delay_mp.begin()->first/m -get_current_time_us()/m,0 );
ev_timer_set(&timer, timer_value,0 );
ev_timer_start(loop, &timer);
}
else

View File

@ -186,8 +186,10 @@ int fec_encode_manager_t::append(char *s,int len/*,int &is_first_packet*/)
{
first_packet_time=get_current_time_us();
const double m=1000*1000;
ev_timer_stop(loop, &timer);
ev_timer_set(&timer, fec_par.timeout/1000000.0 ,0 );
ev_timer_set(&timer, fec_par.timeout/m,0 );
ev_timer_start(loop, &timer);
}
if(fec_par.mode==0)//for type 0 use blob