Browse Source

VLCMedia: Add isEqual

Mike JS. Choi 7 years ago
parent
commit
005bcd7086
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Sources/VLCMedia.m

+ 6 - 0
Sources/VLCMedia.m

@@ -366,6 +366,12 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
     return p_md == [media libVLCMediaDescriptor] ? NSOrderedSame : NSOrderedAscending;
     return p_md == [media libVLCMediaDescriptor] ? NSOrderedSame : NSOrderedAscending;
 }
 }
 
 
+- (BOOL)isEqual:(id)other
+{
+    return ([other isKindOfClass: [VLCMedia class]] &&
+            [other libVLCMediaDescriptor] == p_md);
+}
+
 - (VLCTime *)length
 - (VLCTime *)length
 {
 {
     if (!_length) {
     if (!_length) {