diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-05-06 14:14:32 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-05-06 14:18:53 +0200 |
commit | 380a1de2a82dcdae84250d38b64e7f65fa3c48c5 (patch) | |
tree | 534ab92728e54cfe1fa9e6c7f3e6508671f6760b /src | |
parent | 80f3138e5c4c560f0cc1f8b6720e7e2d1be98ce8 (diff) | |
download | totem-380a1de2a82dcdae84250d38b64e7f65fa3c48c5.tar.gz |
backend: Fix duplicated missing codecs
If there are multiple tracks with the same missing codec, only show a
single line for that codec, rather than as many as the number of tracks
from which it's missing.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/bacon-video-widget.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c index ea9602479..89674a9e8 100644 --- a/src/backend/bacon-video-widget.c +++ b/src/backend/bacon-video-widget.c @@ -345,12 +345,22 @@ static gchar ** bvw_get_missing_plugins_foo (const GList * missing_plugins, MsgToStrFunc func) { GPtrArray *arr = g_ptr_array_new (); + GHashTable *ht; + ht = g_hash_table_new (g_str_hash, g_str_equal); while (missing_plugins != NULL) { - g_ptr_array_add (arr, func (GST_MESSAGE (missing_plugins->data))); + char *tmp; + tmp = func (GST_MESSAGE (missing_plugins->data)); + if (!g_hash_table_lookup (ht, tmp)) { + g_ptr_array_add (arr, tmp); + g_hash_table_insert (ht, tmp, GINT_TO_POINTER (1)); + } else { + g_free (tmp); + } missing_plugins = missing_plugins->next; } g_ptr_array_add (arr, NULL); + g_hash_table_destroy (ht); return (gchar **) g_ptr_array_free (arr, FALSE); } |