VLCKit: remove the prefix from the parameter value and take into account null values...
authorSebastien Zwickert <dilaroga@free.fr>
Mon, 22 Mar 2010 23:13:07 +0000 (00:13 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Tue, 23 Mar 2010 11:13:47 +0000 (12:13 +0100)
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
projects/macosx/framework/Sources/VLCMedia.m

index 3f2f161..8d0d203 100644 (file)
@@ -357,7 +357,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
 
     for( NSString * key in [options allKeys] )
     {
-        libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String]);
+        if ( [options objectForKey:key] != [NSNull null] )
+            libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@=%@", key, [options objectForKey:key]] UTF8String]);
+        else
+            libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@", key] UTF8String]);
+
     }
     return [VLCMedia mediaWithLibVLCMediaDescriptor:p_md];
 }