MacOSX/Framework/VLCMediaPlayer.m: Fix KVO.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 2 Jan 2008 22:49:26 +0000 (22:49 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 2 Jan 2008 22:49:26 +0000 (22:49 +0000)
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m

index e6fa7aa..073953e 100644 (file)
@@ -125,8 +125,18 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 @implementation VLCMediaPlayer
 
 /* Bindings */
-+ (id)keysPathsForValuesAffectingPlaying { return [NSSet setWithObject:@"state"]; }
-+ (id)keysPathsForValuesAffectingSeekable { return [NSSet setWithObjects:@"state", @"media"]; }
++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key
+{
+    static NSDictionary * dict = nil;
+    if( !dict )
+    {
+        dict = [[NSDictionary dictionaryWithObjectsAndKeys:
+            [NSSet setWithObject:@"state"], @"playing",
+            [NSSet setWithObjects:@"state", @"media", nil], @"seekable",
+            nil] retain];
+    }
+    return [dict objectForKey: key];
+}
 
 /* Contructor */
 - (id)init