[vlc-devel] [PATCH 1/2] Made VLCKit's VLCMedia load all URLs.
Derk-Jan Hartman
hartman at videolan.org
Fri Jun 5 15:07:21 CEST 2009
Applied
On 30 mei 2009, at 11:28, Malte Tancred wrote:
> 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.
> ---
> projects/macosx/framework/Sources/VLCMedia.m | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> 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);
>
> --
> 1.6.2.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list