Commit 3836616e authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCMedia.m: Don't forget to init the metaDictionary, when...

MacOSX/Framework/VLCMedia.m: Don't forget to init the metaDictionary, when initing from a media_descriptor object.
parent cf758336
...@@ -280,6 +280,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self) ...@@ -280,6 +280,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
libvlc_media_descriptor_retain( md ); libvlc_media_descriptor_retain( md );
p_md = md; p_md = md;
metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
[self initInternalMediaDescriptor]; [self initInternalMediaDescriptor];
} }
return self; return self;
...@@ -348,7 +349,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self) ...@@ -348,7 +349,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
libvlc_media_descriptor_set_user_data( p_md, (void*)self, &ex ); libvlc_media_descriptor_set_user_data( p_md, (void*)self, &ex );
quit_on_exception( &ex ); quit_on_exception( &ex );
libvlc_event_manager_t *p_em = libvlc_media_descriptor_event_manager( p_md, &ex ); libvlc_event_manager_t *p_em = libvlc_media_descriptor_event_manager( p_md, &ex );
libvlc_event_attach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, &ex); libvlc_event_attach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex); libvlc_event_attach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex);
...@@ -377,7 +378,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self) ...@@ -377,7 +378,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
free(psz_value); free(psz_value);
if ( !(newValue && oldValue && [oldValue compare:newValue] == NSOrderedSame) ) if ( !(newValue && oldValue && [oldValue compare:newValue] == NSOrderedSame) )
{ {
if ([metaType isEqualToString:VLCMetaInformationArtworkURL]) if ([metaType isEqualToString:VLCMetaInformationArtworkURL])
{ {
[NSThread detachNewThreadSelector:@selector(fetchMetaInformationForArtWorkWithURL:) [NSThread detachNewThreadSelector:@selector(fetchMetaInformationForArtWorkWithURL:)
...@@ -385,8 +386,9 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self) ...@@ -385,8 +386,9 @@ static void HandleMediaDurationChanged(const libvlc_event_t *event, void *self)
withObject:newValue]; withObject:newValue];
return; return;
} }
@synchronized(metaDictionary) { @synchronized(metaDictionary) {
[metaDictionary setValue: newValue forKeyPath:metaType]; [metaDictionary setValue:newValue forKeyPath: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