[vlc-devel] [PATCH] Made VLCMedia load all URLs; made VLCOpenGLVoutView ignore -reshape requests when quit is in progress, thus avoiding a segfault.
Malte Tancred
malte at frontbase.com
Thu May 14 12:46:55 CEST 2009
(resending this patch to the list as I wasn't subscribed when I sent
it yesterday)
VLCMedia used only the trailing path part of the URL it was handed. I
changed the roles if initWithPath: and initWithURL: by letting
initWithPath: create an NSURL. With this change I'm able to play
network streams.
The changes to VLCOpenGLVoutView was made to avoid a segfault in
objc_msgSend that occurred as a side-effect of sending -
removeFromSuperview to the VLCVideoView. This patch might just be
treating symptoms, but it didn't seem right go through with all the
code in -reshape if we're in the process of closing down. The segfault
happened on the first line of cocoaglvoutviewLock() in
VLCOpenGLVoutView.m, where I guess either p_vout->p_sys->o_glview or
its -openGLContext pointed to something bad. I'm not sure checking
p_vout->b_die is the right way to go either.
---
modules/gui/minimal_macosx/VLCOpenGLVoutView.m | 9 ++++++++-
projects/macosx/framework/Sources/VLCMedia.m | 8 ++++----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/modules/gui/minimal_macosx/VLCOpenGLVoutView.m b/modules/
gui/minimal_macosx/VLCOpenGLVoutView.m
index bb3b1c5..878ecfb 100644
--- a/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
+++ b/modules/gui/minimal_macosx/VLCOpenGLVoutView.m
@@ -96,9 +96,10 @@ void cocoaglvoutviewEnd( vout_thread_t * p_vout )
[o_cocoaglview_container removeVoutSubview: p_vout->p_sys-
>o_glview];
[p_vout->p_sys->o_glview release];
+ p_vout->p_sys->o_glview = nil;
[p_vout->p_sys->o_pool release];
-
+ p_vout->p_sys->o_pool = nil;
}
/
*****************************************************************************
@@ -305,6 +306,12 @@ void cocoaglvoutviewUnlock( vout_thread_t *
p_vout )
return;
}
+ if( p_vout->b_die )
+ {
+ [objectLock unlock];
+ return;
+ }
+
cocoaglvoutviewLock( p_vout );
NSRect bounds = [self bounds];
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.2
More information about the vlc-devel
mailing list