Commit 6e4e8abd authored by Felix Paul Kühne's avatar Felix Paul Kühne

media list: embed the libvlc event attachment in a serial queue

parent fbc26105
......@@ -272,8 +272,12 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
if (!em)
return;
libvlc_event_attach( em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, (__bridge void *)(self));
libvlc_event_attach( em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, (__bridge void *)(self));
/* We need the caller to wait until this block is done.
* The initialized object shall not be returned until the event attachments are done. */
dispatch_sync(_serialMediaObjectsQueue,^{
libvlc_event_attach( em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, (__bridge void *)(self));
libvlc_event_attach( em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, (__bridge void *)(self));
});
}
- (void)mediaListItemAdded:(NSArray *)arrayOfArgs
......
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