[vlc-devel] commit: VLCKit: url support for VLCMedia (Malte Tancred )

git version control git at videolan.org
Fri Jun 5 15:05:09 CEST 2009


vlc | branch: master | Malte Tancred <malte at frontbase.com> | Fri Jun  5 15:04:40 2009 +0200| [f459c2719e6cd740f3cb81180cab009907b781cc] | committer: Derk-Jan Hartman 

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 <hartman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f459c2719e6cd740f3cb81180cab009907b781cc
---

 THANKS                                       |    1 +
 projects/macosx/framework/Sources/VLCMedia.m |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/THANKS b/THANKS
index ef25a83..66fc913 100644
--- a/THANKS
+++ b/THANKS
@@ -178,6 +178,7 @@ Ludovic Fauvet <etix # l0cal dot com> - Qt4 patch
 Lukas Durfina <lukas.durfina at gmail.com> - Qt4: full screen controller. Teletext button fix. Various fixes.
 Luqman Hakim <ovdl qt rocketmail dot com> - Indonesian translation
 Mahrazi Mohd Kamal <mahrazi at gmail.com> - Malay Translation
+Malte Tancred <malte at frontbase dot com> - VLCKit patch for URLs
 Marc Nolette <nolette at videotron.ca> - PVR support in DirectShow input
 Marco Munderloh <Marco.Munderloh at web.de> - HTTP fix for Win32 to URL filenames
 Marián Hikaník <podnety _at_ mojepreklady _dot_ net> - Slovak localisation
diff --git a/projects/macosx/framework/Sources/VLCMedia.m b/projects/macosx/framework/Sources/VLCMedia.m
index 3756178..a55a042 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);
         




More information about the vlc-devel mailing list