For each item that was appended or deleted, the ("Tracks", NULL) pair<br>was inserted (duplicated over and over) in the tracklist_properties<br>dictionary. The dictionary was inserting it in the same position and<br>

it assumed it had hash collisions, triggering an expansion at every<br>insertion of that pair.<br><br>Create a has_key function for the dictionary.<br>Check if the key is present before inserting in the dict again, at<br>

playlist_item_append, playlist_item_deleted events.<br>---<br> include/vlc_arrays.h        |    8 ++++++++<br> modules/control/dbus/dbus.c |    3 ++-<br> 2 files changed, 10 insertions(+), 1 deletions(-)<br><br>diff --git a/include/vlc_arrays.h b/include/vlc_arrays.h<br>

index 68ea1e2..6643197 100644<br>--- a/include/vlc_arrays.h<br>+++ b/include/vlc_arrays.h<br>@@ -451,7 +451,15 @@ static inline void vlc_dictionary_clear( vlc_dictionary_t * p_dict,<br>     p_dict->i_size = 0;<br> }<br>

 <br>+static inline int<br>+vlc_dictionary_has_key( const vlc_dictionary_t * p_dict, const char * psz_key )<br>+{<br>+    if( !p_dict->p_entries )<br>+        return 0;<br> <br>+    int i_pos = DictHash( psz_key, p_dict->i_size );<br>

+    return p_dict->p_entries[i_pos] != NULL;<br>+}<br> <br> static inline void *<br> vlc_dictionary_value_for_key( const vlc_dictionary_t * p_dict, const char * psz_key )<br>diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c<br>

index 21945e2..f8b3377 100644<br>--- a/modules/control/dbus/dbus.c<br>+++ b/modules/control/dbus/dbus.c<br>@@ -556,7 +556,8 @@ static void ProcessEvents( intf_thread_t *p_intf,<br>                 vlc_dictionary_insert( &player_properties, "CanPlay", NULL );<br>

             }<br> <br>-            vlc_dictionary_insert( &tracklist_properties, "Tracks", NULL );<br>+            if( !vlc_dictionary_has_key( &tracklist_properties, "Tracks" ) )<br>+                vlc_dictionary_insert( &tracklist_properties, "Tracks", NULL );<br>

             break;<br>         case SIGNAL_VOLUME_MUTED:<br>         case SIGNAL_VOLUME_CHANGE:<br>-- <br>1.7.7<br><br>