Commit 0b09c89e authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework: Don't attempt to set a value of a dictionary that is being...

MacOSX/Framework: Don't attempt to set a value of a dictionary that is being monitored by KVO on non-main thread. That's not thread-safe.
parent 76d02025
......@@ -74,6 +74,7 @@ NSString * VLCMediaMetaChanged = @"VLCMediaMetaChanged";
/* Operations */
- (void)fetchMetaInformationFromLibVLCWithType:(NSString*)metaType;
- (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL;
- (void)setArtwork:(NSImage *)art;
/* Callback Methods */
- (void)metaChanged:(NSString *)metaType;
......@@ -496,15 +497,17 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
// If anything was found, lets save it to the meta data dictionary
if (art)
{
@synchronized(metaDictionary)
{
[metaDictionary setObject:art forKey:VLCMetaInformationArtwork];
}
[self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
}
[pool release];
}
- (void)setArtwork:(NSImage *)art
{
[metaDictionary setObject:art forKey:@"artwork"];
}
- (void)metaChanged:(NSString *)metaType
{
[self fetchMetaInformationFromLibVLCWithType:metaType];
......
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