X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fbeos_specific.cpp;h=51c70cf8a8182b9caeb871e1b55dab9c037c16f0;hb=12ade3e3bc975d5426ba4af155b7372c31093b31;hp=7e0e74c29d598aeb4f3f78dd29cc6f04b94cd2e2;hpb=2cb472dba008f7d877ffe6bae9c5575253365282;p=vlc diff --git a/src/misc/beos_specific.cpp b/src/misc/beos_specific.cpp index 7e0e74c29d..51c70cf8a8 100644 --- a/src/misc/beos_specific.cpp +++ b/src/misc/beos_specific.cpp @@ -33,7 +33,12 @@ extern "C" { -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include "../libvlc.h" } /***************************************************************************** @@ -66,46 +71,48 @@ private: #include "../../modules/gui/beos/MsgVals.h" #define REALLY_QUIT 'requ' +static vlc_object_t *p_appthread; + extern "C" { /***************************************************************************** * Local prototypes. *****************************************************************************/ -static void AppThread( vlc_object_t *p_appthread ); +static void* AppThread( vlc_object_t *p_appthread ); /***************************************************************************** * system_Init: create a BApplication object and fill in program path. *****************************************************************************/ -void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] ) +void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] ) { - p_this->p_libvlc->p_appthread = + p_appthread = (vlc_object_t *)vlc_object_create( p_this, sizeof(vlc_object_t) ); /* Create the BApplication thread and wait for initialization */ - vlc_thread_create( p_this->p_libvlc->p_appthread, "app thread", AppThread, - VLC_THREAD_PRIORITY_LOW, VLC_TRUE ); + vlc_thread_create( p_appthread, "app thread", AppThread, + VLC_THREAD_PRIORITY_LOW, true ); } /***************************************************************************** * system_Configure: check for system specific configuration options. *****************************************************************************/ -void system_Configure( vlc_t *, int *pi_argc, char *ppsz_argv[] ) +void system_Configure( libvlc_int_t *, int *pi_argc, const char *ppsz_argv[] ) { } /***************************************************************************** * system_End: destroy the BApplication object. *****************************************************************************/ -void system_End( vlc_t *p_this ) +void system_End( libvlc_int_t *p_this ) { /* Tell the BApplication to die */ be_app->PostMessage( REALLY_QUIT ); - vlc_thread_join( p_this->p_libvlc->p_appthread ); - vlc_object_destroy( p_this->p_libvlc->p_appthread ); + vlc_thread_join( p_appthread ); + vlc_object_release( p_appthread ); - free( p_this->p_libvlc->psz_vlcpath ); + free( psz_vlcpath ); } /* following functions are local */ @@ -113,15 +120,18 @@ void system_End( vlc_t *p_this ) /***************************************************************************** * AppThread: the BApplication thread. *****************************************************************************/ -static void AppThread( vlc_object_t * p_this ) +static void* AppThread( vlc_object_t * p_this ) { + int canc = vlc_savecancel (); VlcApplication * BeApp = new VlcApplication("application/x-vnd.videolan-vlc"); - vlc_object_attach( p_this, p_this->p_vlc ); + vlc_object_attach( p_this, p_this->p_libvlc ); BeApp->p_this = p_this; BeApp->Run(); vlc_object_detach( p_this ); delete BeApp; + vlc_restorecancel (canc); + return NULL; } } /* extern "C" */ @@ -172,7 +182,7 @@ void VlcApplication::ReadyToRun( ) BEntry entry( &info.ref ); entry.GetPath( &path ); path.GetParent( &path ); - p_this->p_libvlc->psz_vlcpath = strdup( path.Path() ); + psz_vlcpath = strdup( path.Path() ); /* Tell the main thread we are finished initializing the BApplication */ vlc_thread_ready( p_this ); @@ -233,7 +243,7 @@ bool VlcApplication::QuitRequested() { if( !fReadyToQuit ) { - p_this->p_vlc->b_die = 1; + libvlc_Quit( p_this->p_libvlc ); return false; }