ソースを参照

MacOSX/Framework/VLCMedia.m: Make sure we compare the media_descriptor and not the url, as we can have two perfect different media (different meta, different option), but with the same url.

Pierre d'Herbemont 17 年 前
コミット
a5221c58c3
1 ファイル変更5 行追加3 行削除
  1. 5 3
      Sources/VLCMedia.m

+ 5 - 3
Sources/VLCMedia.m

@@ -263,12 +263,14 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
 
 - (NSComparisonResult)compare:(VLCMedia *)media
 {
-    if (self == 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)
         return NSOrderedSame;
     else if (!media)
         return NSOrderedDescending;
-    else
-        return [[[self url] absoluteString] compare:[[media url] absoluteString]];
+    return NSOrderedAscending;
 }
 
 @synthesize delegate;