diff --git a/fec_manager.h b/fec_manager.h index 12b32bc..215b8bd 100644 --- a/fec_manager.h +++ b/fec_manager.h @@ -190,7 +190,16 @@ struct fec_parameter_t return 0; } + int clone_fec(fec_parameter_t & other) + { + assert(other.rs_cnt>=1); + rs_cnt=other.rs_cnt; + memcpy(rs_par,other.rs_par,sizeof(rs_parameter_t)*rs_cnt); + + version++; + return 0; + } }; extern fec_parameter_t g_fec_par; diff --git a/misc.cpp b/misc.cpp index e9715d8..6965823 100644 --- a/misc.cpp +++ b/misc.cpp @@ -292,10 +292,7 @@ int handle_command(char *s) mylog(log_warn,"failed to parse [%s]\n",tmp_str); return -1; } - int version=g_fec_par.version; - g_fec_par.clone(tmp_par); - g_fec_par.version=version; - g_fec_par.version++; + g_fec_par.clone_fec(tmp_par); strcpy(rs_par_str,tmp_str); //g_fec_data_num=a; //g_fec_redundant_num=b;