Commit 3dfec6e8 authored by Jakob Leben's avatar Jakob Leben

Qt4: correct fix for duplicate items in playlist - service-discovery

Hypothesis: The bug stems from a thread concurrency problem. A PLModel::rebuild() happens
just between SD inserting items into the core playlist and Qt playlist receiving item-added callback.
Thus, the items referred to the callback are inserted twice into the Qt playlist.

Solution: check if item already inserted at callback processing.
parent f4e0745e
......@@ -667,6 +667,9 @@ void PLModel::processItemAppend( const playlist_add_t *p_add )
PLItem *nodeItem = findById( rootItem, p_add->i_node );
if( !nodeItem ) return;
foreach( PLItem *existing, nodeItem->children )
if( existing->i_id == p_add->i_item ) { return; }
PL_LOCK;
p_item = playlist_ItemGetById( p_playlist, p_add->i_item );
if( !p_item || p_item->i_flags & PLAYLIST_DBL_FLAG ) goto end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment