From: Malte Tancred Date: Fri, 5 Jun 2009 13:04:40 +0000 (+0200) Subject: VLCKit: url support for VLCMedia X-Git-Tag: 1.1.0-ff~5580 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f459c2719e6cd740f3cb81180cab009907b781cc;p=vlc VLCKit: url support for VLCMedia The class VLCMedia used only the trailing path part of the URL it was handed. I changed the roles of initWithPath: and initWithURL: by letting initWithPath: create an NSURL, and initWithURL: hand the complete URL to libvlc_media_new. With this change I'm able to play network streams, not just local movie files. Signed-off-by: Derk-Jan Hartman --- diff --git a/THANKS b/THANKS index ef25a8316c..66fc913e9c 100644 --- a/THANKS +++ b/THANKS @@ -178,6 +178,7 @@ Ludovic Fauvet - Qt4 patch Lukas Durfina - Qt4: full screen controller. Teletext button fix. Various fixes. Luqman Hakim - Indonesian translation Mahrazi Mohd Kamal - Malay Translation +Malte Tancred - VLCKit patch for URLs Marc Nolette - PVR support in DirectShow input Marco Munderloh - HTTP fix for Win32 to URL filenames Marián Hikaník - Slovak localisation diff --git a/projects/macosx/framework/Sources/VLCMedia.m b/projects/macosx/framework/Sources/VLCMedia.m index 37561783b1..a55a042807 100644 --- a/projects/macosx/framework/Sources/VLCMedia.m +++ b/projects/macosx/framework/Sources/VLCMedia.m @@ -168,12 +168,12 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) return [[[VLCMedia alloc] initAsNodeWithName:aName] autorelease]; } -- (id)initWithURL:(NSURL *)anURL +- (id)initWithPath:(NSString *)aPath { - return [self initWithPath:[anURL path]]; + return [self initWithURL:[NSURL fileURLWithPath:aPath isDirectory:NO]]; } -- (id)initWithPath:(NSString *)aPath +- (id)initWithURL:(NSURL *)anURL { if (self = [super init]) { @@ -181,7 +181,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) libvlc_exception_init(&ex); p_md = libvlc_media_new([VLCLibrary sharedInstance], - [aPath UTF8String], + [[anURL absoluteString] UTF8String], &ex); catch_exception(&ex);