mirror of
https://github.com/wangyu-/UDPspeeder.git
synced 2025-01-31 12:19:35 +08:00
just commit
This commit is contained in:
parent
a5c26c5814
commit
67e2ed7457
@ -413,7 +413,7 @@ int fec_encode_manager_t::input(char *s,int len/*,int &is_first_packet*/)
|
||||
int input_buf_idx=counter-1;
|
||||
assert(ready_for_output==0);
|
||||
ready_for_output=1;
|
||||
first_packet_time_for_output=0;
|
||||
//first_packet_time_for_output=0;
|
||||
output_n=1;
|
||||
|
||||
int tmp_idx=0;
|
||||
|
@ -134,6 +134,10 @@ public:
|
||||
return first_packet_time_for_output;
|
||||
}
|
||||
|
||||
int get_type()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
u64_t get_timer_fd64();
|
||||
int re_init(int data_num,int redundant_num,int mtu,int pending_num,int pending_time,int type);
|
||||
int input(char *s,int len/*,int &is_first_packet*/);
|
||||
|
14
main.cpp
14
main.cpp
@ -190,15 +190,19 @@ int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,ch
|
||||
my_time_t common_latency=0;
|
||||
my_time_t first_packet_time=conn_info.fec_encode_manager.get_first_packet_time();
|
||||
|
||||
if(fix_latency==1&&first_packet_time!=0)
|
||||
if(fix_latency==1&&conn_info.fec_encode_manager.get_type()==0&&first_packet_time!=0)
|
||||
{
|
||||
my_time_t current_time=get_current_time_us();
|
||||
my_time_t tmp;
|
||||
if((my_time_t)fec_pending_time >=(current_time - first_packet_time))
|
||||
{
|
||||
tmp=(my_time_t)fec_pending_time-(current_time - first_packet_time);
|
||||
mylog(log_info,"delay=%llu\n",tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp=0;
|
||||
}
|
||||
else tmp=0;
|
||||
common_latency+=tmp;
|
||||
}
|
||||
|
||||
@ -1219,7 +1223,7 @@ void process_arg(int argc, char *argv[])
|
||||
{"mtu", required_argument, 0, 1},
|
||||
{"mode", required_argument, 0,1},
|
||||
{"timeout", required_argument, 0,1},
|
||||
{"--decode-buf", required_argument, 0,1},
|
||||
{"decode-buf", required_argument, 0,1},
|
||||
{"queue-len", required_argument, 0,'q'},
|
||||
{"fec", required_argument, 0,'f'},
|
||||
{"jitter", required_argument, 0,'j'},
|
||||
@ -1498,9 +1502,9 @@ void process_arg(int argc, char *argv[])
|
||||
else if(strcmp(long_options[option_index].name,"decode-buf")==0)
|
||||
{
|
||||
sscanf(optarg,"%d",&fec_buff_num);
|
||||
if(fec_buff_num<100 || fec_buff_num>20000)
|
||||
if(fec_buff_num<300 || fec_buff_num>20000)
|
||||
{
|
||||
mylog(log_fatal,"decode-buf value must be between 100 and 20000 (kbyte) \n");
|
||||
mylog(log_fatal,"decode-buf value must be between 300 and 20000 (kbyte) \n");
|
||||
myexit(-1);
|
||||
}
|
||||
mylog(log_info,"decode-buf=%d\n",fec_buff_num);
|
||||
|
Loading…
x
Reference in New Issue
Block a user