- int i;
-
- mmd->dbt_change = -1; /* no change nec., set to new dbt num by com_cdt */
- if (!dblist[1].name)
- goto dopey;
- if (conf.dbtool_given) {
- for (i = 0; dblist[i].name; i++) {
- if (strcmp(dblist[i].name, conf.dbtool_arg))
- continue;
- PARA_NOTICE_LOG("initializing %s database tool\n",
- dblist[i].name);
- if (dblist[i].init(&dblist[i]) < 0) {
- PARA_WARNING_LOG("init %s failed",
- dblist[i].name);
- goto dopey;
- }
- mmd->dbt_num = i;
- return;
- }
- PARA_WARNING_LOG("%s", "no such dbtool, switching to dopey\n");
- goto dopey;
- }
- /* use the first dbtool that works
- * (assuming that dopey always works)
- */
- for (i = 1; dblist[i].name; i++) {
- int ret = dblist[i].init(&dblist[i]);
- if (ret >= 0) {
- PARA_INFO_LOG("initialized %s\n", dblist[i].name);
- mmd->dbt_num = i;
- return;
+ int i, ret;
+
+ mmd->selector_change = -1; /* no change nec., set to new num by com_chs */
+ if (!conf.selector_given)
+ goto random;
+ for (i = 0; dblist[i].name; i++) {
+ if (strcmp(dblist[i].name, conf.selector_arg))
+ continue;
+ PARA_NOTICE_LOG("initializing %s audio file selector\n",
+ dblist[i].name);
+ ret = dblist[i].init(&dblist[i]);
+ if (ret < 0) {
+ PARA_WARNING_LOG("%s", PARA_STRERROR(-ret));
+ break;