Commit fac2543c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

VLCKit/VLCMedia.m: Fix the compare: function.

parent 6576b0b2
...@@ -132,6 +132,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self) ...@@ -132,6 +132,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
static void HandleMediaStateChanged(const libvlc_event_t * event, void * self) static void HandleMediaStateChanged(const libvlc_event_t * event, void * self)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(setStateAsNumber:) withMethod:@selector(setStateAsNumber:)
withArgumentAsObject:[NSNumber numberWithInt: withArgumentAsObject:[NSNumber numberWithInt:
...@@ -263,14 +264,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -263,14 +264,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
- (NSComparisonResult)compare:(VLCMedia *)media - (NSComparisonResult)compare:(VLCMedia *)media
{ {
libvlc_media_descriptor_t * anOtherMd = [media libVLCMediaDescriptor]; if (self == media)
/* We can release, we'll just use ptr */
libvlc_media_descriptor_release(anOtherMd);
if (self == media || p_md == anOtherMd)
return NSOrderedSame; return NSOrderedSame;
else if (!media) if (!media)
return NSOrderedDescending; return NSOrderedDescending;
return NSOrderedAscending; return p_md == [media libVLCMediaDescriptor] ? NSOrderedSame : NSOrderedAscending;
} }
@synthesize delegate; @synthesize delegate;
......
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