changeset 3161:31355fc2bb9a trunk

- Assertion not being called anymore
author mf0102 <0102@gmx.at>
date Tue, 24 Jul 2007 22:26:32 +0200
parents 03ff51c6412f
children 5161ced1bce2 d087e747efb7
files src/audacious/mime.c
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/mime.c	Tue Jul 24 13:17:23 2007 -0500
+++ b/src/audacious/mime.c	Tue Jul 24 22:26:32 2007 +0200
@@ -24,22 +24,23 @@
 
 void mime_set_plugin(const gchar *mimetype, InputPlugin *ip)
 {
-	g_return_if_fail(mimetype != NULL);
-	g_return_if_fail(ip != NULL);
+    g_return_if_fail(mimetype != NULL);
+    g_return_if_fail(ip != NULL);
 
-	if (mime_type_dict == NULL)
-		mime_type_dict = mowgli_dictionary_create(strcasecmp);
-
-	mowgli_dictionary_add(mime_type_dict, mimetype, ip);
+    if (mime_type_dict == NULL)
+        mime_type_dict = mowgli_dictionary_create(strcasecmp);
+    else if (mowgli_dictionary_find(mime_type_dict, mimetype))
+        mowgli_dictionary_delete(mime_type_dict, mimetype);
+    mowgli_dictionary_add(mime_type_dict, mimetype, ip);
 }
 
 InputPlugin *mime_get_plugin(const gchar *mimetype)
 {
-	if (mimetype == NULL)
-		return NULL;
+    if (mimetype == NULL)
+        return NULL;
 
-	if (mime_type_dict == NULL)
-		return NULL;
+    if (mime_type_dict == NULL)
+        return NULL;
 
-	return mowgli_dictionary_retrieve(mime_type_dict, mimetype);
+    return mowgli_dictionary_retrieve(mime_type_dict, mimetype);
 }