Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
a5221c58c3
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  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;