[vlc-commits] macosx: fixed incorrect URL creation (closes #4966)
Felix Paul Kühne
git at videolan.org
Mon Jun 20 17:35:47 CEST 2011
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jun 20 17:34:15 2011 +0200| [7b032f22308b6d2c9aabc50dfb94263270c9aa73] | committer: Felix Paul Kühne
macosx: fixed incorrect URL creation (closes #4966)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b032f22308b6d2c9aabc50dfb94263270c9aa73
---
modules/gui/macosx/embeddedwindow.m | 9 ++++++++-
modules/gui/macosx/misc.m | 17 +++++++++++++++--
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m
index 56d4d5f..82b4d33 100644
--- a/modules/gui/macosx/embeddedwindow.m
+++ b/modules/gui/macosx/embeddedwindow.m
@@ -32,6 +32,7 @@
#import "embeddedwindow.h"
#import "fspanel.h"
#import "playlist.h"
+#import <vlc_url.h>
/* SetSystemUIMode, ... */
#import <Carbon/Carbon.h>
@@ -904,7 +905,13 @@
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], NULL);
+ 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/misc.m b/modules/gui/macosx/misc.m
index c20f835..b70b211 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -29,6 +29,7 @@
#import "misc.h"
#import "playlist.h"
#import "controls.h"
+#import <vlc_url.h>
/*****************************************************************************
* NSImage (VLCAdditions)
@@ -510,7 +511,13 @@ static NSMutableArray *blackoutWindows = NULL;
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], NULL);
+ 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];
}
[(VLCPlaylist *)[[VLCMain sharedInstance] playlist] appendArray: o_array atPos: -1 enqueue:NO];
@@ -589,7 +596,13 @@ static NSMutableArray *blackoutWindows = NULL;
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], NULL);
+ 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 )
More information about the vlc-commits
mailing list