[vlc-devel] commit: macosx/framework: Re-enable event posting in VLCEventManager. ( Pierre d'Herbemont )
git version control
git at videolan.org
Mon Aug 24 17:46:55 CEST 2009
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Mon Aug 24 17:46:21 2009 +0200| [b573c18182ab0c5d879377385c536f1470084811] | committer: Pierre d'Herbemont
macosx/framework: Re-enable event posting in VLCEventManager.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b573c18182ab0c5d879377385c536f1470084811
---
.../macosx/framework/Sources/VLCEventManager.m | 26 ++++++++++----------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/projects/macosx/framework/Sources/VLCEventManager.m b/projects/macosx/framework/Sources/VLCEventManager.m
index 6158fee..71a8068 100644
--- a/projects/macosx/framework/Sources/VLCEventManager.m
+++ b/projects/macosx/framework/Sources/VLCEventManager.m
@@ -209,7 +209,7 @@ static void * EventDispatcherMainLoop(void * user_data)
- (void)callOnMainThreadDelegateOfObject:(id)aTarget withDelegateMethod:(SEL)aSelector withNotificationName: (NSString *)aNotificationName
{
/* Don't send on main thread before this gets sorted out */
-// NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
message_t message =
{
@@ -219,19 +219,19 @@ static void * EventDispatcherMainLoop(void * user_data)
VLCNotification
};
-// if( [NSThread isMainThread] )
-// {
+ if( [NSThread isMainThread] )
+ {
[self callDelegateOfObjectAndSendNotificationWithArgs:[[NSData dataWithBytes:&message length:sizeof(message_t)] retain] /* released in the call */];
-// }
-// else
-// {
-// pthread_mutex_lock( [self queueLock] );
-// [[self messageQueue] insertObject:[NSData dataWithBytes:&message length:sizeof(message_t)] atIndex:0];
-// pthread_cond_signal( [self signalData] );
-// pthread_mutex_unlock( [self queueLock] );
-// }
+ }
+ else
+ {
+ pthread_mutex_lock( [self queueLock] );
+ [[self messageQueue] insertObject:[NSData dataWithBytes:&message length:sizeof(message_t)] atIndex:0];
+ pthread_cond_signal( [self signalData] );
+ pthread_mutex_unlock( [self queueLock] );
+ }
-// [pool release];
+ [pool release];
}
- (void)callOnMainThreadObject:(id)aTarget withMethod:(SEL)aSelector withArgumentAsObject: (id)arg
@@ -278,7 +278,7 @@ static void * EventDispatcherMainLoop(void * user_data)
- (void)callDelegateOfObject:(id) aTarget withDelegateMethod:(SEL)aSelector withNotificationName: (NSString *)aNotificationName
{
- // [[NSNotificationCenter defaultCenter] postNotification: [NSNotification notificationWithName:aNotificationName object:aTarget]];
+ [[NSNotificationCenter defaultCenter] postNotification: [NSNotification notificationWithName:aNotificationName object:aTarget]];
if (![aTarget delegate] || ![[aTarget delegate] respondsToSelector:aSelector])
return;
More information about the vlc-devel
mailing list