diff options
author | Felipe Contreras <felipe.contreras@nokia.com> | 2010-03-09 00:52:07 +0200 |
---|---|---|
committer | Felipe Contreras <felipe.contreras@nokia.com> | 2010-03-09 18:39:11 +0200 |
commit | f7b8a9e1e342fe96a8022ddd933993e4b9666389 (patch) | |
tree | 606a64b36b0a5fffdefd94abed2de80888ab32b3 | |
parent | 8175d1b1f470453572c3ea56a0f616a9b4d04b7b (diff) |
plugin: make element_table const
Will be useful in next patches, but it's good in itself. Also, no need
to inialize to zero global variables.
Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
-rw-r--r-- | omx/gstomx.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c index e9b0e70..08ef23d 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -63,7 +63,7 @@ GST_DEBUG_CATEGORY (gstomx_debug); -static GstStructure *element_table = NULL; +const static GstStructure *element_table; static GQuark element_name_quark; extern const gchar *default_config; @@ -141,7 +141,7 @@ fetch_element_table (void) { gchar *path; gchar *config, *s; - GstStructure *element; + GstStructure *tmp, *element; path = get_config_path (); @@ -155,21 +155,23 @@ fetch_element_table (void) GST_DEBUG ("parsing config:\n%s", config); - element_table = gst_structure_empty_new ("element_table"); + tmp = gst_structure_empty_new ("element_table"); s = config; while ((element = gst_structure_from_string (s, &s))) { const gchar *element_name = gst_structure_get_name (element); - gst_structure_set (element_table, + gst_structure_set (tmp, element_name, GST_TYPE_STRUCTURE, element, NULL); } if (config != default_config) g_free (config); - GST_DEBUG ("element_table=%" GST_PTR_FORMAT, element_table); + GST_DEBUG ("element_table=%" GST_PTR_FORMAT, tmp); + + element_table = tmp; } static GstStructure * @@ -177,7 +179,7 @@ get_element_entry (const gchar *element_name) { GstStructure *element; - if (!gst_structure_get (element_table, element_name, + if (!gst_structure_get ((GstStructure *) element_table, element_name, GST_TYPE_STRUCTURE, &element, NULL)) { element = NULL; |