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"; ...@@ -74,6 +74,7 @@ NSString * VLCMediaMetaChanged = @"VLCMediaMetaChanged";
/* Operations */ /* Operations */
- (void)fetchMetaInformationFromLibVLCWithType:(NSString*)metaType; - (void)fetchMetaInformationFromLibVLCWithType:(NSString*)metaType;
- (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL; - (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL;
- (void)setArtwork:(NSImage *)art;
/* Callback Methods */ /* Callback Methods */
- (void)metaChanged:(NSString *)metaType; - (void)metaChanged:(NSString *)metaType;
...@@ -496,15 +497,17 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -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 anything was found, lets save it to the meta data dictionary
if (art) if (art)
{ {
@synchronized(metaDictionary) [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
{
[metaDictionary setObject:art forKey:VLCMetaInformationArtwork];
}
} }
[pool release]; [pool release];
} }
- (void)setArtwork:(NSImage *)art
{
[metaDictionary setObject:art forKey:@"artwork"];
}
- (void)metaChanged:(NSString *)metaType - (void)metaChanged:(NSString *)metaType
{ {
[self fetchMetaInformationFromLibVLCWithType: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