]> git.sesse.net Git - vlc/commitdiff
gui/macosx: set URL instead of path to ITEM_URL. Fixes #3706
authorSebastien Zwickert <dilaroga@free.fr>
Thu, 17 Jun 2010 22:06:11 +0000 (00:06 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Jun 2010 23:13:39 +0000 (01:13 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/macosx/intf.m
modules/gui/macosx/open.m
modules/gui/macosx/playlist.m

index 6a06c054e901443ce4c0cc8efd2f7217b5629991..75652e5d0062c0ca50b77959820893827da8cfd7 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_common.h>
 #include <vlc_keys.h>
 #include <vlc_dialog.h>
+#include <vlc_url.h>
 #include <unistd.h> /* execl() */
 
 #import "intf.h"
@@ -1044,7 +1045,14 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
 - (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename
 {
     BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" );
-    NSDictionary *o_dic = [NSDictionary dictionaryWithObjectsAndKeys: o_filename, @"ITEM_URL", nil];
+    char *psz_uri = make_URI([o_filename UTF8String]);
+    if( !psz_uri )
+        return( FALSE );
+
+    NSDictionary *o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
+
+    free( psz_uri );
+
     if( b_autoplay )
         [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue: NO];
     else
index 3460c4e430bf57e395a423af63b1dfda8ffe7be6..025c94f2649c128bd073fe6d54d18d9eeca25087 100644 (file)
@@ -963,7 +963,14 @@ static VLCOpen *_o_sharedMainInstance = nil;
         for( i = 0; i < (int)[o_values count]; i++)
         {
             NSDictionary *o_dic;
-            o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
+            char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String]);
+            if( !psz_uri )
+                continue;
+
+            o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
+
+            free( psz_uri );
+
             o_array = [o_array arrayByAddingObject: o_dic];
         }
         if( b_autoplay )
index 09e2458b3c852dce1cda9fdd127c7da70d29111f..db1b8e08f2eebe2105bf03b1b1474d525208124e 100644 (file)
@@ -54,6 +54,8 @@
 #import <vlc_osd.h>
 #import <vlc_interface.h>
 
+#include <vlc_url.h>
+
 
 /*****************************************************************************
  * VLCPlaylistView implementation
         for( i = 0; i < (int)[o_values count]; i++)
         {
             NSDictionary *o_dic;
-            o_dic = [NSDictionary dictionaryWithObject:[o_values
-                        objectAtIndex:i] forKey:@"ITEM_URL"];
+            char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String]);
+            if( !psz_uri )
+                continue;
+
+            o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
+
+            free( psz_uri );
+
             o_array = [o_array arrayByAddingObject: o_dic];
         }