#include <assert.h>
#include <vlc_common.h>
+#include <vlc_modules.h>
+#include <vlc_interface.h>
-#include <vlc_aout.h>
-#include <vlc_vout.h>
-
-#include "vlc_interface.h"
#if defined( __APPLE__ ) || defined( WIN32 )
#include "../control/libvlc_internal.h"
#endif
* Local prototypes
*****************************************************************************/
static void* RunInterface( vlc_object_t *p_this );
-#if defined( __APPLE__ ) || defined( WIN32 )
+#if defined( __APPLE__ )
static void * MonitorLibVLCDeath( vlc_object_t *p_this );
#endif
static int AddIntfCallback( vlc_object_t *, char const *,
{
libvlc_int_t *p_libvlc = p_this->p_libvlc;
intf_thread_t * p_intf;
+ static const char psz_type[] = "interface";
/* Allocate structure */
- p_intf = vlc_object_create( p_libvlc, VLC_OBJECT_INTF );
+ p_intf = vlc_custom_create( p_libvlc, sizeof( *p_intf ),
+ VLC_OBJECT_GENERIC, psz_type );
if( !p_intf )
return VLC_ENOMEM;
/* Attach interface to LibVLC */
vlc_object_attach( p_intf, p_libvlc );
-#if defined( __APPLE__ ) || defined( WIN32 )
+#if defined( __APPLE__ )
p_intf->b_should_run_on_first_thread = false;
#endif
}
vlc_mutex_lock( &lock );
- if( !vlc_object_alive( p_libvlc ) )
- {
- vlc_mutex_unlock( &lock );
- goto error; /* Too late! */
- }
-#if defined( __APPLE__ ) || defined( WIN32 )
+#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 )
{
intf_thread_t *p_first;
- assert( !vlc_object_alive( p_libvlc ) );
-
vlc_mutex_lock( &lock );
p_first = libvlc_priv( p_libvlc )->p_intf;
#ifndef NDEBUG
return NULL;
}
-#if defined( __APPLE__ ) || defined( WIN32 )
+#if defined( __APPLE__ )
#include "control/libvlc_internal.h" /* libvlc_InternalWait */
/**
* MonitorLibVLCDeath: Used when b_should_run_on_first_thread is set.