summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2004-06-19 19:48:42 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2004-06-19 19:48:42 +0000
commit0207ae8d246fb74bdab61b637e05baf01b437a57 (patch)
treebe906159f105a33f7c213dd503b3ce9d81442602
parent3b9e4c039149b2c55294d13519cb42cb8ec12091 (diff)
downloadxine-lib-0207ae8d246fb74bdab61b637e05baf01b437a57.tar.gz
xine-lib-0207ae8d246fb74bdab61b637e05baf01b437a57.tar.bz2
readd the decoder's name to the description of the config entry, but do
it right this time: use a different pointer for every decoder by putting the descriptions into a dynamically growing chunk of heap memory the name of the decoder in the description is necessary, because frontends should not have to display the config entry key and this is currently the only string to contain the decoder's name CVS patchset: 6709 CVS date: 2004/06/19 19:48:42
-rw-r--r--src/xine-engine/load_plugins.c19
-rw-r--r--src/xine-engine/plugin_catalog.h7
2 files changed, 23 insertions, 3 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index deb9b83ab..853b0fb8c 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.181 2004/06/16 15:41:37 valtri Exp $
+ * $Id: load_plugins.c,v 1.182 2004/06/19 19:48:42 mroi Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -295,6 +295,7 @@ static void _insert_plugin (xine_t *this,
plugin_info_t *info,
int api_version){
+ plugin_catalog_t *catalog = this->plugin_catalog;
plugin_node_t *entry;
vo_info_t *vo_new, *vo_old;
ao_info_t *ao_new, *ao_old;
@@ -305,6 +306,7 @@ static void _insert_plugin (xine_t *this,
uint32_t *types;
int priority = 0;
char key[80];
+ char desc[100];
int i;
if (info->API != api_version) {
@@ -361,14 +363,25 @@ static void _insert_plugin (xine_t *this,
priority = decoder_new->priority = decoder_old->priority;
sprintf(key, "decoder.%s_priority", info->id);
+ sprintf(desc, _("priority for %s decoder"), info->id);
+ /* write the description on the heap because the config system
+ * does not strdup() it, so we have to provide a different pointer
+ * for each decoder */
+ if (catalog->prio_desc_size - catalog->prio_desc_next < strlen(desc) + 1) {
+ catalog->prio_desc_size += 1024;
+ catalog->prio_desc_mem = (char *)realloc(catalog->prio_desc_mem,
+ catalog->prio_desc_size * sizeof(char));
+ }
+ strcpy(catalog->prio_desc_mem + catalog->prio_desc_next, desc);
this->config->register_num (this->config,
key,
0,
- _("priority for decoder"),
+ catalog->prio_desc_mem + catalog->prio_desc_next,
_("The priority provides a ranking in case some media "
"can be handled by more than one decoder.\n"
"A priority of 0 enables the decoder's default priority."), 20,
_decoder_priority_cb, (void *)this);
+ catalog->prio_desc_next += strlen(desc) + 1;
/* reset priority on old config files */
if (this->config->current_version < 1)
@@ -2266,6 +2279,8 @@ void _x_dispose_plugins (xine_t *this) {
dispose_plugin_list (this->plugin_catalog->post);
dispose_plugin_list (this->plugin_catalog->cache);
+
+ free (this->plugin_catalog->prio_desc_mem);
free (this->plugin_catalog);
}
}
diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h
index cc45828e8..4077bcda3 100644
--- a/src/xine-engine/plugin_catalog.h
+++ b/src/xine-engine/plugin_catalog.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: plugin_catalog.h,v 1.14 2003/12/09 00:02:36 f1rmb Exp $
+ * $Id: plugin_catalog.h,v 1.15 2004/06/19 19:48:42 mroi Exp $
*
* xine-internal header: Definitions for plugin lists
*
@@ -70,6 +70,11 @@ struct plugin_catalog_s {
plugin_node_t *spu_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
const char *ids[PLUGIN_MAX];
+
+ /* memory block for the decoder priority config entry descriptions */
+ char *prio_desc_mem;
+ int prio_desc_next;
+ int prio_desc_size;
pthread_mutex_t lock;
};