struct intf_thread_t *p_next; /** LibVLC interfaces book keeping */
vlc_thread_t thread; /** LibVLC thread */
/* Thread properties and locks */
-#if defined( __APPLE__ )
- bool b_should_run_on_first_thread;
-#endif
/* Specific interfaces */
intf_sys_t * p_sys; /** system interface */
#import <AddressBook/AddressBook.h> /* for crashlog send mechanism */
#import <Sparkle/Sparkle.h> /* we're the update delegate */
+#include "../../../lib/libvlc_internal.h"
+
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
[VLCApplication sharedApplication];
+
intf_thread_t *p_intf = (intf_thread_t*) p_this;
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
/* subscribe to LibVLCCore's messages */
vlc_Subscribe( &p_intf->p_sys->sub, MsgCallback, NULL );
- p_intf->pf_run = Run;
- p_intf->b_should_run_on_first_thread = true;
+
+ libvlc_SetExitHandler( p_intf->p_libvlc, vlc_object_kill, p_intf );
+ Run( p_intf );
[o_pool release];
return VLC_SUCCESS;
[[VLCMain sharedInstance] applicationWillTerminate:nil];
[o_appLock release];
[o_pool release];
+
+ raise(SIGTERM);
}
#pragma mark -
var_AddCallback( p_intf, "intf-add", AddIntfCallback, NULL );
/* Attach interface to LibVLC */
-#if defined( __APPLE__ )
- p_intf->b_should_run_on_first_thread = false;
-#endif
/* Choose the best module */
p_intf->p_cfg = NULL;
goto error;
}
-#if defined( __APPLE__ )
- /* Hack to get Mac OS X Cocoa runtime running
- * (it needs access to the main thread) */
- if( p_intf->b_should_run_on_first_thread )
- {
- libvlc_SetExitHandler( p_libvlc, vlc_object_kill, p_intf );
- assert( p_intf->pf_run );
- p_intf->pf_run( p_intf );
- p_intf->pf_run = NULL;
- }
-#endif
/* Run the interface in a separate thread */
if( p_intf->pf_run
&& vlc_clone( &p_intf->thread,