]> git.sesse.net Git - vlc/commitdiff
Remove intf_ShouldDie
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 14 Sep 2008 08:14:24 +0000 (11:14 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 14 Sep 2008 08:14:24 +0000 (11:14 +0300)
libvlc kills the interfaces when it dies anyway.

13 files changed:
include/vlc_interface.h
modules/control/gestures.c
modules/control/lirc.c
modules/control/netsync.c
modules/control/rc.c
modules/control/showintf.c
modules/gui/beos/Interface.cpp
modules/gui/fbosd.c
modules/gui/ncurses.c
modules/gui/pda/pda.c
modules/gui/qt4/main_interface.cpp
modules/gui/wince/timer.cpp
modules/gui/wxwidgets/timer.cpp

index 58b40b807e4d577abd3948ae131096de945ed505..c24f7b91a1e71a03179cb789736623b075ff24c5 100644 (file)
@@ -108,10 +108,6 @@ VLC_EXPORT( intf_thread_t *, __intf_Create,     ( vlc_object_t *, const char * )
 VLC_EXPORT( int,               intf_RunThread,  ( intf_thread_t * ) );
 VLC_EXPORT( void,              intf_StopThread, ( intf_thread_t * ) );
 
-/* If the interface is in the main thread, it should listen both to
- * p_intf->b_die and p_libvlc->b_die */
-#define intf_ShouldDie( p_intf ) (p_intf->b_die || p_intf->p_libvlc->b_die )
-
 #define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
 VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) );
 
index e849d0dfca298ff75a73687a11bb87061b76d8a7..d0bb0291328b25332c1df3f6236b7a899c8697df 100644 (file)
@@ -182,7 +182,7 @@ static void RunIntf( intf_thread_t *p_intf )
     msg_Dbg( p_intf, "interface thread initialized" );
 
     /* Main loop */
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         vlc_mutex_lock( &p_intf->change_lock );
 
@@ -461,7 +461,7 @@ static int InitThread( intf_thread_t * p_intf )
 {
     char *psz_button;
     /* we might need some locking here */
-    if( !intf_ShouldDie( p_intf ) )
+    if( vlc_object_alive( p_intf ) )
     {
         /* p_intf->change_lock locking strategy:
          * - Every access to p_intf->p_sys are locked threw p_intf->change_lock
index 63f4e4fcfc4fd1ca8ee37622cd02eb4550fa610c..c82dcc588641c113cf528b7cfd21bc2ff7958424 100644 (file)
@@ -175,7 +175,7 @@ static int Process( intf_thread_t *p_intf )
         if( code == NULL )
             return 0;
 
-        while( !intf_ShouldDie( p_intf )
+        while( vlc_object_alive( p_intf )
                 && (lirc_code2char( p_intf->p_sys->config, code, &c ) == 0)
                 && (c != NULL) )
         {
index 1062548dc8a7903620aee811453b2b9042f57f20..11f59c792a4eff6dd9a7ff9b09015da83d6708bb 100644 (file)
@@ -150,7 +150,7 @@ static void Run( intf_thread_t *p_intf )
     /* High priority thread */
     vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_INPUT );
 
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         /* Update the input */
         if( p_input == NULL )
index ad6150a7d5df1707de13876afacf2752b6c91ade..448ebf46ffd510c519248fa95968ae0efb54682d 100644 (file)
@@ -479,7 +479,7 @@ static void Run( intf_thread_t *p_intf )
     }
 #endif
 
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         char *psz_cmd, *psz_arg;
         bool b_complete;
@@ -2050,7 +2050,7 @@ bool ReadWin32( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
     while( WaitForSingleObject( p_intf->p_sys->hConsoleIn,
                                 INTF_IDLE_SLEEP/1000 ) == WAIT_OBJECT_0 )
     {
-        while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
+        while( vlc_object_alive( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
                ReadConsoleInput( p_intf->p_sys->hConsoleIn, &input_record,
                                  1, &i_dw ) )
         {
@@ -2120,7 +2120,7 @@ bool ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
     }
 #endif
 
-    while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
+    while( vlc_object_alive( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
            (i_read = net_Read( p_intf, p_intf->p_sys->i_socket == -1 ?
                        0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket, NULL,
                   (uint8_t *)p_buffer + *pi_size, 1, false ) ) > 0 )
index d1360dfdf8ecf7aa0fb6002ba71281be8aa499d2..a59cad6c899dc5450597c37cc1cc09cc801542b1 100644 (file)
@@ -121,7 +121,7 @@ static void RunIntf( intf_thread_t *p_intf )
     }
 
     /* Main loop */
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         vlc_mutex_lock( &p_intf->change_lock );
 
@@ -179,7 +179,7 @@ static void RunIntf( intf_thread_t *p_intf )
  *****************************************************************************/
 static int InitThread( intf_thread_t * p_intf )
 {
-    if( !intf_ShouldDie( p_intf ) )
+    if( vlc_object_alive( p_intf ) )
     {
         vlc_mutex_lock( &p_intf->change_lock );
 
index 859c618e8a1d26374dd886338545c0f4e14e5b31..c1c5f62acdb040680d809827235bcfbbfaf34f97 100644 (file)
@@ -120,7 +120,7 @@ void CloseIntf ( vlc_object_t *p_this )
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         p_intf->p_sys->p_window->UpdateInterface();
         msleep( INTF_IDLE_SLEEP );
index 4723feac0c8edcbccb31004787583d3010655c00..ef3de6dc43a69419dcf9dd1d3e73c048d1c47729 100644 (file)
@@ -1272,7 +1272,7 @@ static void Run( intf_thread_t *p_intf )
     intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
     int canc = vlc_savecancel();
 
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         int i;
 
index 7b490c07b5f3d9b16fda79815e6b2fd70b0af336..3ea7a9f5b9d59ada597a471167061be7c24bf7d7 100644 (file)
@@ -404,7 +404,7 @@ static void Run( intf_thread_t *p_intf )
     var_AddCallback( p_playlist, "item-append", PlaylistChanged, p_intf );
     var_AddCallback( p_playlist, "item-change", PlaylistChanged, p_intf );
 
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         msleep( INTF_IDLE_SLEEP );
 
index 429a5f13875a250a50961df838392b996471615b..5776b67fe5f474a029bd13c9ff9c884332230d03 100644 (file)
@@ -317,7 +317,7 @@ static void Run( intf_thread_t *p_intf )
 
 #ifdef NEED_GTK2_MAIN
     msg_Dbg( p_intf, "Manage GTK keyboard events using threads" );
-    while( !intf_ShouldDie( p_intf ) )
+    while( vlc_object_alive( p_intf ) )
     {
         Manage( p_intf );
 
@@ -516,14 +516,14 @@ static int Manage( intf_thread_t *p_intf )
         }
         vlc_object_unlock( p_input );
     }
-    else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) )
+    else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) )
     {
         GtkModeManage( p_intf );
         p_intf->p_sys->b_playing = 0;
     }
 
 #ifndef NEED_GTK2_MAIN
-    if( intf_ShouldDie( p_intf ) )
+    if( !vlc_object_alive( p_intf ) )
     {
         vlc_mutex_unlock( &p_intf->change_lock );
 
index 608ff5200a4fea4d93265b4b3557c582ee2d2745..764222feca2b477a3fc4dd73d6b1a9b75be3a5df 100644 (file)
@@ -924,7 +924,7 @@ void MainInterface::setRate( int rate )
 void MainInterface::updateOnTimer()
 {
     /* No event for dying */
-    if( intf_ShouldDie( p_intf ) )
+    if( !vlc_object_alive( p_intf ) )
     {
         QApplication::closeAllWindows();
         QApplication::quit();
index fdacaf57c872064b68d247a9bc8d335436ad3a8c..cdf2acf10b410c92b536dfc5d07191da5aabbc4b 100644 (file)
@@ -210,14 +210,14 @@ void Timer::Notify( void )
             }
         }
     }
-    else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) )
+    else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) )
     {
         p_intf->p_sys->b_playing = 0;
         p_main_interface->TogglePlayButton( PAUSE_S );
         i_old_playing_status = PAUSE_S;
     }
 
-    if( intf_ShouldDie( p_intf ) )
+    if( !vlc_object_alive( p_intf ) )
     {
         vlc_mutex_unlock( &p_intf->change_lock );
 
index f65b090f0c671b98911a54b70180f4189c448449..b8e4a2de06aacd65c55eea0ca59ff95e5a54a267 100644 (file)
@@ -96,7 +96,7 @@ void Timer::Notify()
         p_intf->p_sys->b_intf_show = false;
     }
 
-    if( intf_ShouldDie( p_intf ) )
+    if( !vlc_object_alive( p_intf ) )
     {
         vlc_mutex_unlock( &p_intf->change_lock );