From 4cffc5102dce5e61bd97057595a744c2238d882a Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Thu, 14 May 2015 23:28:08 +0200 Subject: [PATCH] Initialize cfg for refresh_interval --- src/cfg.c | 18 ++++++++++++------ src/cfg.h | 4 +++- src/ezstream.c | 3 ++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index 1b5ed21..873ef3f 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -117,6 +117,18 @@ _cfg_load(void) return (0); } +int +cfg_init(void) +{ + _cfg_reset(&cfg); +} + +void +cfg_exit(void) +{ + _cfg_reset(&cfg); +} + int cfg_reload(void) { @@ -132,12 +144,6 @@ cfg_reload(void) return (0); } -void -cfg_exit(void) -{ - _cfg_reset(&cfg); -} - int cfg_stream_str2fmt(const char *str, enum cfg_stream_format *fmt_p) { diff --git a/src/cfg.h b/src/cfg.h index dab3f20..62b8982 100644 --- a/src/cfg.h +++ b/src/cfg.h @@ -62,9 +62,11 @@ enum cfg_stream_format { #include "cfg_decoder.h" #include "cfg_encoder.h" -int cfg_reload(void); +int cfg_init(void); void cfg_exit(void); +int cfg_reload(void); + int cfg_stream_str2fmt(const char *, enum cfg_stream_format *); const char * cfg_stream_fmt2str(enum cfg_stream_format); diff --git a/src/ezstream.c b/src/ezstream.c index ecbdc89..ed3a435 100644 --- a/src/ezstream.c +++ b/src/ezstream.c @@ -1007,7 +1007,8 @@ main(int argc, char *argv[]) unsigned int i; #endif ret = 1; - if (0 > cmdline_parse(argc, argv, &ret) || + if (0 > cfg_init() || + 0 > cmdline_parse(argc, argv, &ret) || 0 > log_init() || 0 > cfg_decoder_init() || 0 > cfg_encoder_init() ||