Explorar el Código

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 hace 17 años
padre
commit
a5221c58c3
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  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;