diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/configfile.c | 16 | ||||
-rw-r--r-- | src/xine-engine/configfile.h | 13 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 25 |
3 files changed, 28 insertions, 26 deletions
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 0efc4d70c..28cc51257 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: configfile.c,v 1.49 2003/07/12 12:31:14 mroi Exp $ + * $Id: configfile.c,v 1.50 2003/07/31 11:59:10 mroi Exp $ * * config object (was: file) management - implementation * @@ -670,6 +670,16 @@ void xine_config_load (xine_t *xine, const char *filename) { if (line[0] == '#') continue; + + if (line[0] == '.') { + if (strncmp(line, ".version:", 9) == 0) { + sscanf(line + 9, "%d", &this->current_version); + if (this->current_version > CONFIG_FILE_VERSION) + xine_log(xine, XINE_LOG_MSG, + _("The current config file has been modified by a newer version of xine.")); + } + continue; + } if ((value = strchr (line, ':'))) { @@ -771,7 +781,8 @@ void xine_config_save (xine_t *xine, const char *filename) { cfg_entry_t *entry; - fprintf (f_config, "#\n# xine config file\n#\n\n"); + fprintf (f_config, "#\n# xine config file\n#\n"); + fprintf (f_config, ".version:%d\n\n", CONFIG_FILE_VERSION); pthread_mutex_lock(&this->config_lock); entry = this->first; @@ -926,6 +937,7 @@ config_values_t *xine_config_init () { this->first = NULL; this->last = NULL; + this->current_version = 0; pthread_mutex_init(&this->config_lock, NULL); diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h index 6889a8987..30514e2b9 100644 --- a/src/xine-engine/configfile.h +++ b/src/xine-engine/configfile.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: configfile.h,v 1.23 2003/06/27 13:40:51 mroi Exp $ + * $Id: configfile.h,v 1.24 2003/07/31 11:59:10 mroi Exp $ * * config file management * @@ -39,6 +39,8 @@ extern "C" { # include <xine.h> #endif +#define CONFIG_FILE_VERSION 1 + typedef struct cfg_entry_s cfg_entry_t; typedef struct config_values_s config_values_t; @@ -186,7 +188,12 @@ struct config_values_s { /* * mutex for modification to the config */ - pthread_mutex_t config_lock; + pthread_mutex_t config_lock; + + /* + * current config files version number + */ + int current_version; }; /* @@ -195,7 +202,7 @@ struct config_values_s { config_values_t *xine_config_init (void); /* - * hack: intepret "opt:"-style mrls for config value changes + * interpret stream_setup part of mrls for config value changes */ int xine_config_change_opt(config_values_t *config, const char *opt) ; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index a9201b8b5..239288107 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: load_plugins.c,v 1.156 2003/07/27 23:39:02 siggi Exp $ + * $Id: load_plugins.c,v 1.157 2003/07/31 11:59:10 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -97,7 +97,6 @@ static int _get_decoder_priority (xine_t *this, int default_priority, char str[80]; int result; - int reset; sprintf (str, "decoder.%s_priority", id); @@ -109,10 +108,9 @@ static int _get_decoder_priority (xine_t *this, int default_priority, "can be handled by more than one decoder.\n" "A priority of 0 enables the decoder's default priority.", 20, NULL, NULL /*FIXME: implement callback*/); - /* check for priority reset */ - reset = this->config->lookup_entry(this->config, - "decoder.reset_priorities")->num_value; - if (reset){ + + /* reset priority on old config files */ + if (this->config->current_version < 1) { result = 0; this->config->update_num(this->config, str, 0); } @@ -970,19 +968,6 @@ void scan_plugins (xine_t *this) { } #endif - (void) this->config - ->register_bool(this->config, - "decoder.reset_priorities", - 1, - "if 'true', reset default decoder priorities", - "This will restore all decoder priorities by\n" - " setting them to 0. (= \"use default priority\")\n" - "while dropping user changes, this ensures that\n" - "a sane set of decoders will be used.\n" - "This option is only evaluated once, next time xine is\n" - "started. After that, it resets to 'false'.", - 20, NULL, NULL); - homedir = xine_get_homedir(); this->plugin_catalog = _new_catalog(); load_cached_catalog (this); @@ -1022,8 +1007,6 @@ void scan_plugins (xine_t *this) { load_required_plugins (this); map_decoders (this); - - this->config->update_num(this->config, "decoder.reset_priorities", 0); } /* |