Commit 76ce7342 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

VLCMedia.m: Don't flood the event manager with unused meta change...

VLCMedia.m: Don't flood the event manager with unused meta change notification. Remove uneeded willChangeValueForKey: notification, as per Julien Robert suggestion.
parent 16c3ae28
......@@ -95,6 +95,13 @@ static inline VLCMediaState LibVLCStateToMediaState( libvlc_state_t state )
*/
static void HandleMediaMetaChanged(const libvlc_event_t *event, void *self)
{
if( event->u.media_descriptor_meta_changed.meta_type == libvlc_meta_Publisher ||
event->u.media_descriptor_meta_changed.meta_type == libvlc_meta_NowPlaying )
{
/* Skip those meta. We don't really care about them for now.
* And they occure a lot */
return;
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(metaChanged:)
......@@ -349,7 +356,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t *event, void *self)
p_url = libvlc_media_descriptor_get_mrl( md, &ex );
quit_on_exception( &ex );
url = [[NSString stringWithCString:p_url] retain];
url = [[NSString stringWithUTF8String:p_url] retain];
libvlc_media_descriptor_retain( md );
p_md = md;
......@@ -530,16 +537,12 @@ static void HandleMediaSubItemAdded(const libvlc_event_t *event, void *self)
if (length && value && [length compare:value] == NSOrderedSame)
return;
[self willChangeValueForKey:@"length"];
[length release];
length = value ? [value retain] : nil;
[self didChangeValueForKey:@"length"];
}
- (void)setState:(NSNumber *)newStateAsNumber
{
[self willChangeValueForKey:@"state"];
state = [newStateAsNumber intValue];
[self didChangeValueForKey:@"state"];
}
@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