X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/553d81156ea61e3b3fad5e7fc4d1191ff55ceabb..8cd7d4bca92b0db48af0db692b3394ffdb789025:/lib/configuration.c diff --git a/lib/configuration.c b/lib/configuration.c index 95b8133..ff59968 100644 --- a/lib/configuration.c +++ b/lib/configuration.c @@ -947,6 +947,8 @@ static const struct conf conf[] = { { C(password), &type_string, validate_any }, { C(pause_mode), &type_string, validate_pausemode }, { C(player), &type_stringlist_accum, validate_player }, + { C(playlist_lock_timeout), &type_integer, validate_positive }, + { C(playlist_max) , &type_integer, validate_positive }, { C(plugins), &type_string_accum, validate_isdir }, { C(prefsync), &type_integer, validate_positive }, { C(queue_pad), &type_integer, validate_positive }, @@ -1195,6 +1197,8 @@ static struct config *config_default(void) { c->new_bias_age = 7 * 86400; /* 1 week */ c->new_bias = 4500000; /* 50 times the base weight */ c->sox_generation = DEFAULT_SOX_GENERATION; + c->playlist_max = INT_MAX; /* effectively no limit */ + c->playlist_lock_timeout = 10; /* 10s */ /* Default stopwords */ if(config_set(&cs, (int)NDEFAULT_STOPWORDS, (char **)default_stopwords)) exit(1); @@ -1466,7 +1470,7 @@ char *config_get_file(const char *name) { static int stringlist_compare(const struct stringlist *a, const struct stringlist *b) { - int n, c; + int n = 0, c; while(n < a->n && n < b->n) { if((c = strcmp(a->s[n], b->s[n]))) @@ -1502,7 +1506,7 @@ static int namepart_compare(const struct namepart *a, static int namepartlist_compare(const struct namepartlist *a, const struct namepartlist *b) { - int n, c; + int n = 0, c; while(n < a->n && n < b->n) { if((c = namepart_compare(&a->s[n], &b->s[n])))