Revise parsing for secondary parameters

This commit is contained in:
MrDave
2020-11-26 13:08:43 -07:00
committed by Mr-Dave
parent 5116f5a76c
commit 9021f82f9b
7 changed files with 151 additions and 173 deletions

View File

@@ -820,7 +820,7 @@ int mycopy_packet(AVPacket *dest_pkt, AVPacket *src_pkt){
}
/*********************************************/
static void util_parms_free(struct ctx_params *params)
void util_parms_free(struct ctx_params *params)
{
int indx_parm;
@@ -1118,3 +1118,20 @@ int util_parms_parse(struct ctx_params *params, std::string confline)
return 0;
}
void util_parms_add_default(ctx_params *params, std::string parm_nm, std::string parm_vl)
{
int indx, dflt;
dflt = TRUE;
for (indx = 0; indx < params->params_count; indx++) {
if ( mystreq(params->params_array[indx].param_name, parm_nm.c_str()) ) {
dflt = FALSE;
}
}
if (dflt == TRUE) {
util_parms_add(params, parm_nm.c_str(), parm_vl.c_str());
}
}