[vlc-commits] commit: gui/macosx: set URL instead of path to ITEM_URL. Fixes #3706 ( Sebastien Zwickert )
git at videolan.org
git at videolan.org
Fri Jun 18 01:14:45 CEST 2010
vlc/vlc-1.1 | branch: master | Sebastien Zwickert <dilaroga at free.fr> | Fri Jun 18 00:06:11 2010 +0200| [b0620aea6b50d3062d1240e6d4a3945ca40b5e92] | committer: Jean-Baptiste Kempf
gui/macosx: set URL instead of path to ITEM_URL. Fixes #3706
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit d3ed6bcb51d1bf13be1f035239e085fca3910645)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=b0620aea6b50d3062d1240e6d4a3945ca40b5e92
---
modules/gui/macosx/intf.m | 10 +++++++++-
modules/gui/macosx/open.m | 9 ++++++++-
modules/gui/macosx/playlist.m | 12 ++++++++++--
3 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 6a06c05..75652e5 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -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
diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index 3460c4e..025c94f 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -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 )
diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 09e2458..db1b8e0 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -54,6 +54,8 @@
#import <vlc_osd.h>
#import <vlc_interface.h>
+#include <vlc_url.h>
+
/*****************************************************************************
* VLCPlaylistView implementation
@@ -1779,8 +1781,14 @@
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];
}
More information about the vlc-commits
mailing list