From d21d61e759acc7a390f5e755277d28bea14cf242 Mon Sep 17 00:00:00 2001 From: "valtri@funny.zcu.cz" Date: Fri, 7 Nov 2008 18:56:51 +0100 Subject: Recognise H.264 codec with "XiWave" fourcc too. --- src/xine-engine/buffer_types.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/xine-engine') diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index 911e123ed..8bee0e791 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -659,6 +659,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, -- cgit v1.2.3 From aeb0a48595f6bb5c63e7f1d1d54f21c136c6c249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 7 Nov 2008 19:49:54 +0100 Subject: Fixed segfault on start when using XINE_PLUGIN_PATH. --- src/xine-engine/load_plugins.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 3d1c0e4a8..d8f77c464 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1140,15 +1140,23 @@ void _x_scan_plugins (xine_t *this) { 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 { @@ -1393,7 +1401,6 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha i = 0; while (methods[i] != -1 && !plugin) { int list_id, list_size; - const char *mime_type; stream->content_detection_method = methods[i]; @@ -2461,7 +2468,6 @@ static char *_x_concatenate_with_string(char **strings, size_t count, char *join 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); -- cgit v1.2.3 From 2ba1e128cbb791cfdb2829895a854bb664018912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 20 Nov 2008 20:39:50 +0100 Subject: Fix using of the pointers, leak fixes in configfile. --- src/xine-engine/configfile.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index cfe6f6a35..81acab348 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. * @@ -356,21 +356,22 @@ static const char *config_xlate_internal (const char *key, const xine_config_ent 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... */ @@ -385,6 +386,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) { @@ -396,14 +398,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; + } } } @@ -747,7 +753,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; @@ -755,14 +761,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); @@ -861,7 +867,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; } @@ -943,15 +949,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) { -- cgit v1.2.3 From ea2b5508e35f5125fd65730822b30bb8895ad87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 20 Nov 2008 20:56:19 +0100 Subject: Some warning fixes: XINE_FORMAT_SCANF, statics in headers, consts, ... Add warning flags to the DEBUG_CFLAGS too. --- src/xine-engine/buffer.h | 6 +++--- src/xine-engine/buffer_types.c | 6 +++--- src/xine-engine/load_plugins.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/xine-engine') diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 9a30ea7e8..04fa030bf 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -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. * @@ -622,13 +622,13 @@ fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XIN uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED; /* return codec name given BUF_VIDEO_xxx */ -char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; +const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; /* return BUF_AUDIO_xxx given the formattag */ uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED; /* return codec name given BUF_AUDIO_xxx */ -char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; +const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; #ifndef SUPPORT_ATTRIBUTE_PACKED diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index 8bee0e791..b7571d1d7 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. * @@ -1200,7 +1200,7 @@ static uint32_t cached_buf_type=0; return 0; } -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 +1234,7 @@ static uint32_t cached_buf_type=0; return 0; } -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/load_plugins.c b/src/xine-engine/load_plugins.c index d8f77c464..4f7492c65 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. * @@ -2463,7 +2463,7 @@ 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; -- cgit v1.2.3