# HG changeset patch # User mf0102 <0102@gmx.at> # Date 1185308792 -7200 # Node ID 31355fc2bb9afdf92dc0085d110c56ac57289515 # Parent 03ff51c6412f2cdbabaeec5ef85d2c92e141ee0c - Assertion not being called anymore diff -r 03ff51c6412f -r 31355fc2bb9a src/audacious/mime.c --- 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); }