Commit a8db76ae authored by Sylver Bruneau's avatar Sylver Bruneau Committed by Felix Paul Kühne

VLCMedia: improve URL whitespace handling

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 5703100c
......@@ -217,10 +217,18 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
- (instancetype)initWithURL:(NSURL *)anURL
{
if (self = [super init]) {
const char *url;
VLCLibrary *library = [VLCLibrary sharedLibrary];
NSAssert(library.instance, @"no library instance when creating media");
p_md = libvlc_media_new_location(library.instance, [[[anURL absoluteString] stringByRemovingPercentEncoding] UTF8String]);
if (([[anURL absoluteString] hasPrefix:@"sftp://"]) ||
([[anURL absoluteString] hasPrefix:@"smb://"])) {
url = [[[anURL absoluteString] stringByRemovingPercentEncoding] UTF8String];
} else {
url = [[anURL absoluteString] UTF8String];
}
p_md = libvlc_media_new_location(library.instance, url);
_metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment