diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/buffer_types.c | 8 | ||||
-rw-r--r-- | src/xine-engine/configfile.c | 34 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 25 |
3 files changed, 42 insertions, 25 deletions
diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index 7601e5d7f..9e7c8084b 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -661,6 +661,8 @@ static const video_db_t video_db[] = { ME_FOURCC('a','v','c','1'), ME_FOURCC('h','2','6','4'), ME_FOURCC('H','2','6','4'), + ME_FOURCC('x','2','6','4'), + ME_FOURCC('X','2','6','4'), 0 }, BUF_VIDEO_H264, @@ -1200,7 +1202,7 @@ static uint32_t cached_buf_type=0; return 0; } -const char *_x_buf_video_name( uint32_t buf_type ) { +const char * _x_buf_video_name( uint32_t buf_type ) { int i; buf_type &= 0xffff0000; @@ -1234,7 +1236,7 @@ static uint32_t cached_buf_type=0; return 0; } -const char *_x_buf_audio_name( uint32_t buf_type ) { +const char * _x_buf_audio_name( uint32_t buf_type ) { int i; buf_type &= 0xffff0000; diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index f18cf6661..a3742bb68 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -360,21 +360,22 @@ static char *config_xlate_internal (const char *key, const xine_config_entry_tra return NULL; } -static const char *config_translate_key (const char *key) { +static const char *config_translate_key (const char *key, char **tmp) { /* Returns translated key or, if no translation found, NULL. * Translated key may be in a static buffer allocated within this function. * NOT re-entrant; assumes that config_lock is held. */ unsigned trans; - static char *newkey = NULL; + const char *newkey = NULL; /* first, special-case the decoder entries (so that new ones can be added * without requiring modification of the translation table) */ + *tmp = NULL; if (!strncmp (key, "decoder.", 8) && !strcmp (key + (trans = strlen (key)) - 9, "_priority")) { - asprintf (&newkey, "engine.decoder_priorities.%.*s", trans - 17, key + 8); - return newkey; + asprintf (tmp, "engine.decoder_priorities.%.*s", trans - 17, key + 8); + return *tmp; } /* search the translation table... */ @@ -389,6 +390,7 @@ static void config_lookup_entry_int (config_values_t *this, const char *key, cfg_entry_t **entry, cfg_entry_t **prev) { int trans; + char *tmp = NULL; /* try twice at most (second time with translation from old key name) */ for (trans = 2; trans; --trans) { @@ -400,14 +402,18 @@ static void config_lookup_entry_int (config_values_t *this, const char *key, *entry = (*entry)->next; } - if (*entry) + if (*entry) { + free(tmp); return; + } /* we did not find a match, maybe this is an old config entry name * trying to translate */ - key = config_translate_key(key); - if (!key) + key = config_translate_key(key, &tmp); + if (!key) { + free(tmp); return; + } } } @@ -761,7 +767,7 @@ static int config_register_enum (config_values_t *this, entry->type = XINE_CONFIG_TYPE_ENUM; if (entry->unknown_value) - entry->num_value = config_parse_enum (entry->unknown_value, values); + entry->num_value = config_parse_enum (entry->unknown_value, (const char **)values); else entry->num_value = def_value; @@ -769,14 +775,14 @@ static int config_register_enum (config_values_t *this, entry->num_default = def_value; /* allocate and copy the enum values */ - value_src = values; + value_src = (const char **)values; value_count = 0; while (*value_src) { value_src++; value_count++; } entry->enum_values = malloc (sizeof(char*) * (value_count + 1)); - value_src = values; + value_src = (const char **)values; value_dest = entry->enum_values; while (*value_src) { *value_dest = strdup(*value_src); @@ -875,7 +881,7 @@ static void config_update_string (config_values_t *this, /* if an enum is updated with a string, we convert the string to * its index and use update number */ if (entry->type == XINE_CONFIG_TYPE_ENUM) { - config_update_num(this, key, config_parse_enum(value, entry->enum_values)); + config_update_num(this, key, config_parse_enum(value, (const char **)entry->enum_values)); return; } @@ -957,15 +963,17 @@ void xine_config_load (xine_t *xine, const char *filename) { if (!(entry = config_lookup_entry(this, line))) { const char *key = line; + char *tmp = NULL; pthread_mutex_lock(&this->config_lock); if (this->current_version < CONFIG_FILE_VERSION) { /* old config file -> let's see if we have to rename this one */ - key = config_translate_key(key); + key = config_translate_key(key, &tmp); if (!key) key = line; /* no translation? fall back on untranslated key */ } entry = config_add (this, key, 50); entry->unknown_value = strdup(value); + free(tmp); pthread_mutex_unlock(&this->config_lock); } else { switch (entry->type) { diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 7f0497e78..6f5653cb9 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2006 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -1261,15 +1261,23 @@ void _x_scan_plugins (xine_t *this) { XINE_PROFILE(load_cached_catalog (this)); if ((pluginpath = getenv("XINE_PLUGIN_PATH")) != NULL && *pluginpath) { - char *p = pluginpath - 1; - while (p[1]) + char *p = pluginpath; + while (p && p[0]) { - char *dir, *q = p; - p = strchr (p + 1, XINE_PATH_SEPARATOR_CHAR); + size_t len; + char *dir, *q; + + q = p; + p = strchr (p, XINE_PATH_SEPARATOR_CHAR); + if (p) { + p++; + len = p - q; + } else + len = strlen(q); if (q[0] == '~' && q[1] == '/') - asprintf (&dir, "%s%.*s", homedir, (int)(p - q - 1), q + 1); + asprintf (&dir, "%s%.*s", homedir, (int)(len - 1), q + 1); else - dir = strndup (q, p - q); + dir = strndup (q, len); push_if_dir (plugindirs, dir); /* store or free it */ } } else { @@ -2599,12 +2607,11 @@ void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) { * @param joining String to use to join the various strings together. * @param final_length The pre-calculated final length of the string. */ -static char *_x_concatenate_with_string(char **strings, size_t count, char *joining, size_t final_length) { +static char *_x_concatenate_with_string(char const **strings, size_t count, char *joining, size_t final_length) { size_t i; char *const result = malloc(final_length+1); /* Better be safe */ char *str = result; - size_t pos = 0; for(i = 0; i < count; i++, strings++) { if ( *strings ) { int offset = snprintf(str, final_length, "%s%s", *strings, joining); |