Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 90bb157

Browse files
committed
Revise processing for configuration directory
1 parent 587491f commit 90bb157

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

src/conf.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,12 +3764,24 @@ static void conf_parm_config_dir(ctx_motapp *motapp, std::string confdir)
37643764
if (dp != NULL) {
37653765
while( (ep = readdir(dp)) ) {
37663766
conf_file.assign(ep->d_name);
3767-
if (conf_file.find_first_of(".conf") != std::string::npos) {
3768-
conf_file = confdir + "/" + conf_file;
3769-
MOTPLS_LOG(NTC, TYPE_ALL, NO_ERRNO
3770-
,_("Processing config file %s"), conf_file.c_str() );
3771-
conf_camera_parm(motapp, conf_file);
3772-
motapp->cam_list[motapp->cam_cnt-1]->conf->from_conf_dir = true;
3767+
if (conf_file.length() >= 5) {
3768+
if (conf_file.substr(conf_file.length()-5,5) == ".conf") {
3769+
if (conf_file.find("sound") == std::string::npos) {
3770+
conf_file = confdir + "/" + conf_file;
3771+
MOTPLS_LOG(NTC, TYPE_ALL, NO_ERRNO
3772+
,_("Processing as camera config file %s")
3773+
, conf_file.c_str() );
3774+
conf_camera_parm(motapp, conf_file);
3775+
motapp->cam_list[motapp->cam_cnt-1]->conf->from_conf_dir = true;
3776+
} else {
3777+
conf_file = confdir + "/" + conf_file;
3778+
MOTPLS_LOG(NTC, TYPE_ALL, NO_ERRNO
3779+
,_("Processing as sound config file %s")
3780+
, conf_file.c_str() );
3781+
conf_sound_parm(motapp, conf_file);
3782+
motapp->snd_list[motapp->snd_cnt-1]->conf->from_conf_dir = true;
3783+
}
3784+
}
37733785
}
37743786
}
37753787
}

0 commit comments

Comments
 (0)