// Stop the playlist
vout_OSDMessage( getIntf(), DEFAULT_CHAN, "%s", _( "Quit" ) );
- // Get the instance of OSFactory
- OSFactory *pOsFactory = OSFactory::instance( getIntf() );
-
- // Exit the main OS loop
- pOsFactory->getOSLoop()->exit();
-
// Kill libvlc
libvlc_Quit( getIntf()->p_libvlc );
}
#include "vlcproc.hpp"
#include "os_factory.hpp"
+#include "os_loop.hpp"
#include "os_timer.hpp"
#include "var_manager.hpp"
+#include "vout_manager.hpp"
#include "theme.hpp"
#include "window_manager.hpp"
#include "../commands/async_queue.hpp"
void VlcProc::manage()
{
+#ifdef WIN32
+ if( !vlc_object_alive( getIntf() ) &&
+ !getIntf()->p_sys->b_exitRequested )
+ {
+ getIntf()->p_sys->b_exitRequested = true;
+
+ // explicitly stop the playlist
+ playlist_Stop( getIntf()->p_sys->p_playlist );
+
+ if( !VoutManager::instance( getIntf() )->hasVout() )
+ getIntf()->p_sys->b_exitOK = true;
+ }
+
+ if( getIntf()->p_sys->b_exitOK )
+ {
+ // Get the instance of OSFactory
+ OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+
+ // Exit the main OS loop
+ pOsFactory->getOSLoop()->exit();
+
+ return;
+ }
+#else
// Did the user request to quit vlc ?
if( !vlc_object_alive( getIntf() ) )
{
- CmdQuit *pCmd = new CmdQuit( getIntf() );
- AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
- pQueue->push( CmdGenericPtr( pCmd ) );
+ // Get the instance of OSFactory
+ OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+
+ // Exit the main OS loop
+ pOsFactory->getOSLoop()->exit();
+
+ return;
}
+#endif
refreshPlaylist();
refreshAudio();
refreshInput();
}
+
void VlcProc::CmdManage::execute()
{
// Just forward to VlcProc
void *VoutManager::getWindow( intf_thread_t *pIntf, vout_window_t *pWnd )
{
+
+#ifdef WIN32
+ if( pIntf->p_sys->b_exitRequested )
+ return NULL;
+#endif
+
// Theme may have been destroyed
if( !pIntf->p_sys->p_theme )
return NULL;
}
}
+#ifdef WIN32
+ if( pIntf->p_sys->b_exitRequested )
+ pIntf->p_sys->b_exitOK = ( pThis->m_SavedVoutVec.size() == 0 );
+#endif
+
+
pThis->unlockVout();
}
// get the VoutMainWindow
VoutMainWindow* getVoutMainWindow() { return m_pVoutMainWindow; }
+ // test if vout are running
+ bool hasVout() { return ( m_SavedVoutVec.size() != 0 ) ; }
+
// (un)lock functions to protect vout sets
void lockVout( ) { vlc_mutex_lock( &vout_lock ); }
void unlockVout( ) { vlc_mutex_unlock( &vout_lock ); }