From: Pierre d'Herbemont Date: Fri, 1 Feb 2008 18:58:26 +0000 (+0000) Subject: VLCKit/VLCMedia.m: Fix the compare: function. X-Git-Tag: 0.9.0-test0~3028 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fac2543c284b118c54054c3de9615d8b5218128c;p=vlc VLCKit/VLCMedia.m: Fix the compare: function. --- diff --git a/extras/MacOSX/Framework/Sources/VLCMedia.m b/extras/MacOSX/Framework/Sources/VLCMedia.m index 5eb8d280ae..0cb5819d65 100644 --- a/extras/MacOSX/Framework/Sources/VLCMedia.m +++ b/extras/MacOSX/Framework/Sources/VLCMedia.m @@ -132,6 +132,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self) static void HandleMediaStateChanged(const libvlc_event_t * event, void * self) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + [[VLCEventManager sharedManager] callOnMainThreadObject:self withMethod:@selector(setStateAsNumber:) withArgumentAsObject:[NSNumber numberWithInt: @@ -263,14 +264,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) - (NSComparisonResult)compare:(VLCMedia *)media { - libvlc_media_descriptor_t * anOtherMd = [media libVLCMediaDescriptor]; - /* We can release, we'll just use ptr */ - libvlc_media_descriptor_release(anOtherMd); - if (self == media || p_md == anOtherMd) + if (self == media) return NSOrderedSame; - else if (!media) + if (!media) return NSOrderedDescending; - return NSOrderedAscending; + return p_md == [media libVLCMediaDescriptor] ? NSOrderedSame : NSOrderedAscending; } @synthesize delegate;