From 3b1b5d32d6ba896b7ebf1309d3932fcf2aba7bd4 Mon Sep 17 00:00:00 2001 From: Fred Wu Date: Sat, 2 Jul 2022 15:48:39 +0800 Subject: [PATCH 1/4] Clone a fec_parameter_t with fec changed only --- fec_manager.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fec_manager.h b/fec_manager.h index 12b32bc..0ec3861 100644 --- a/fec_manager.h +++ b/fec_manager.h @@ -190,7 +190,14 @@ 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); + return 0; + } }; extern fec_parameter_t g_fec_par; From 89e7e294f2e55f13aafe250550fb7ed747fc94ee Mon Sep 17 00:00:00 2001 From: Fred Wu Date: Sat, 2 Jul 2022 15:59:02 +0800 Subject: [PATCH 2/4] Update misc.cpp Fix a bug which resets all parameters to default value when writing a fec parameter to the fifo file. --- misc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/misc.cpp b/misc.cpp index e9715d8..f56e2d5 100644 --- a/misc.cpp +++ b/misc.cpp @@ -292,9 +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.clone_fec(tmp_par); g_fec_par.version++; strcpy(rs_par_str,tmp_str); //g_fec_data_num=a; From 0261c75c29f21448996637bc2e90c6516d50fa54 Mon Sep 17 00:00:00 2001 From: Fred Wu Date: Sat, 2 Jul 2022 16:02:30 +0800 Subject: [PATCH 3/4] Update fec_manager.h --- fec_manager.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fec_manager.h b/fec_manager.h index 0ec3861..215b8bd 100644 --- a/fec_manager.h +++ b/fec_manager.h @@ -195,6 +195,8 @@ struct fec_parameter_t 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; } From c6437cccbb57366749e615161936390edb78ece8 Mon Sep 17 00:00:00 2001 From: Fred Wu Date: Sat, 2 Jul 2022 16:03:34 +0800 Subject: [PATCH 4/4] Update misc.cpp --- misc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/misc.cpp b/misc.cpp index f56e2d5..6965823 100644 --- a/misc.cpp +++ b/misc.cpp @@ -293,7 +293,6 @@ int handle_command(char *s) return -1; } g_fec_par.clone_fec(tmp_par); - g_fec_par.version++; strcpy(rs_par_str,tmp_str); //g_fec_data_num=a; //g_fec_redundant_num=b;