Changeset 36aca393c55082aab87d0564e225305da24e6e52
- Timestamp:
- 14/09/08 10:14:24
(3 months ago)
- Author:
- Rémi Denis-Courmont <rdenis@simphalempin.com>
- git-committer:
- Rémi Denis-Courmont <rdenis@simphalempin.com> 1221380064 +0300
- git-parent:
[872779fbce6fe19c7d66d845c709e99defcbffbb]
- git-author:
- Rémi Denis-Courmont <rdenis@simphalempin.com> 1221380064 +0300
- Message:
Remove intf_ShouldDie
libvlc kills the interfaces when it dies anyway.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r88f2243 |
r36aca39 |
|
| 109 | 109 | VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) ); |
|---|
| 110 | 110 | |
|---|
| 111 | | /* If the interface is in the main thread, it should listen both to |
|---|
| 112 | | * p_intf->b_die and p_libvlc->b_die */ |
|---|
| 113 | | #define intf_ShouldDie( p_intf ) (p_intf->b_die || p_intf->p_libvlc->b_die ) |
|---|
| 114 | | |
|---|
| 115 | 111 | #define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b) |
|---|
| 116 | 112 | VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) ); |
|---|
| r1cfa877 |
r36aca39 |
|
| 183 | 183 | |
|---|
| 184 | 184 | /* Main loop */ |
|---|
| 185 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 185 | while( vlc_object_alive( p_intf ) ) |
|---|
| 186 | 186 | { |
|---|
| 187 | 187 | vlc_mutex_lock( &p_intf->change_lock ); |
|---|
| … | … | |
| 462 | 462 | char *psz_button; |
|---|
| 463 | 463 | /* we might need some locking here */ |
|---|
| 464 | | if( !intf_ShouldDie( p_intf ) ) |
|---|
| | 464 | if( vlc_object_alive( p_intf ) ) |
|---|
| 465 | 465 | { |
|---|
| 466 | 466 | /* p_intf->change_lock locking strategy: |
|---|
| r91f0104 |
r36aca39 |
|
| 176 | 176 | return 0; |
|---|
| 177 | 177 | |
|---|
| 178 | | while( !intf_ShouldDie( p_intf ) |
|---|
| | 178 | while( vlc_object_alive( p_intf ) |
|---|
| 179 | 179 | && (lirc_code2char( p_intf->p_sys->config, code, &c ) == 0) |
|---|
| 180 | 180 | && (c != NULL) ) |
|---|
| r872779f |
r36aca39 |
|
| 151 | 151 | vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_INPUT ); |
|---|
| 152 | 152 | |
|---|
| 153 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 153 | while( vlc_object_alive( p_intf ) ) |
|---|
| 154 | 154 | { |
|---|
| 155 | 155 | /* Update the input */ |
|---|
| r1cfa877 |
r36aca39 |
|
| 480 | 480 | #endif |
|---|
| 481 | 481 | |
|---|
| 482 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 482 | while( vlc_object_alive( p_intf ) ) |
|---|
| 483 | 483 | { |
|---|
| 484 | 484 | char *psz_cmd, *psz_arg; |
|---|
| … | … | |
| 2051 | 2051 | INTF_IDLE_SLEEP/1000 ) == WAIT_OBJECT_0 ) |
|---|
| 2052 | 2052 | { |
|---|
| 2053 | | while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH && |
|---|
| | 2053 | while( vlc_object_alive( p_intf ) && *pi_size < MAX_LINE_LENGTH && |
|---|
| 2054 | 2054 | ReadConsoleInput( p_intf->p_sys->hConsoleIn, &input_record, |
|---|
| 2055 | 2055 | 1, &i_dw ) ) |
|---|
| … | … | |
| 2121 | 2121 | #endif |
|---|
| 2122 | 2122 | |
|---|
| 2123 | | while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH && |
|---|
| | 2123 | while( vlc_object_alive( p_intf ) && *pi_size < MAX_LINE_LENGTH && |
|---|
| 2124 | 2124 | (i_read = net_Read( p_intf, p_intf->p_sys->i_socket == -1 ? |
|---|
| 2125 | 2125 | 0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket, NULL, |
|---|
| r1cfa877 |
r36aca39 |
|
| 122 | 122 | |
|---|
| 123 | 123 | /* Main loop */ |
|---|
| 124 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 124 | while( vlc_object_alive( p_intf ) ) |
|---|
| 125 | 125 | { |
|---|
| 126 | 126 | vlc_mutex_lock( &p_intf->change_lock ); |
|---|
| … | … | |
| 180 | 180 | static int InitThread( intf_thread_t * p_intf ) |
|---|
| 181 | 181 | { |
|---|
| 182 | | if( !intf_ShouldDie( p_intf ) ) |
|---|
| | 182 | if( vlc_object_alive( p_intf ) ) |
|---|
| 183 | 183 | { |
|---|
| 184 | 184 | vlc_mutex_lock( &p_intf->change_lock ); |
|---|
| r3561b9b |
r36aca39 |
|
| 121 | 121 | static void Run( intf_thread_t *p_intf ) |
|---|
| 122 | 122 | { |
|---|
| 123 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 123 | while( vlc_object_alive( p_intf ) ) |
|---|
| 124 | 124 | { |
|---|
| 125 | 125 | p_intf->p_sys->p_window->UpdateInterface(); |
|---|
| r1cfa877 |
r36aca39 |
|
| 1273 | 1273 | int canc = vlc_savecancel(); |
|---|
| 1274 | 1274 | |
|---|
| 1275 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 1275 | while( vlc_object_alive( p_intf ) ) |
|---|
| 1276 | 1276 | { |
|---|
| 1277 | 1277 | int i; |
|---|
| r1cfa877 |
r36aca39 |
|
| 405 | 405 | var_AddCallback( p_playlist, "item-change", PlaylistChanged, p_intf ); |
|---|
| 406 | 406 | |
|---|
| 407 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 407 | while( vlc_object_alive( p_intf ) ) |
|---|
| 408 | 408 | { |
|---|
| 409 | 409 | msleep( INTF_IDLE_SLEEP ); |
|---|
| r1cfa877 |
r36aca39 |
|
| 318 | 318 | #ifdef NEED_GTK2_MAIN |
|---|
| 319 | 319 | msg_Dbg( p_intf, "Manage GTK keyboard events using threads" ); |
|---|
| 320 | | while( !intf_ShouldDie( p_intf ) ) |
|---|
| | 320 | while( vlc_object_alive( p_intf ) ) |
|---|
| 321 | 321 | { |
|---|
| 322 | 322 | Manage( p_intf ); |
|---|
| … | … | |
| 517 | 517 | vlc_object_unlock( p_input ); |
|---|
| 518 | 518 | } |
|---|
| 519 | | else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) ) |
|---|
| | 519 | else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) ) |
|---|
| 520 | 520 | { |
|---|
| 521 | 521 | GtkModeManage( p_intf ); |
|---|
| … | … | |
| 524 | 524 | |
|---|
| 525 | 525 | #ifndef NEED_GTK2_MAIN |
|---|
| 526 | | if( intf_ShouldDie( p_intf ) ) |
|---|
| | 526 | if( !vlc_object_alive( p_intf ) ) |
|---|
| 527 | 527 | { |
|---|
| 528 | 528 | vlc_mutex_unlock( &p_intf->change_lock ); |
|---|
| rf4f357d |
r36aca39 |
|
| 925 | 925 | { |
|---|
| 926 | 926 | /* No event for dying */ |
|---|
| 927 | | if( intf_ShouldDie( p_intf ) ) |
|---|
| | 927 | if( !vlc_object_alive( p_intf ) ) |
|---|
| 928 | 928 | { |
|---|
| 929 | 929 | QApplication::closeAllWindows(); |
|---|
| rcc51620 |
r36aca39 |
|
| 211 | 211 | } |
|---|
| 212 | 212 | } |
|---|
| 213 | | else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) ) |
|---|
| | 213 | else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) ) |
|---|
| 214 | 214 | { |
|---|
| 215 | 215 | p_intf->p_sys->b_playing = 0; |
|---|
| … | … | |
| 218 | 218 | } |
|---|
| 219 | 219 | |
|---|
| 220 | | if( intf_ShouldDie( p_intf ) ) |
|---|
| | 220 | if( !vlc_object_alive( p_intf ) ) |
|---|
| 221 | 221 | { |
|---|
| 222 | 222 | vlc_mutex_unlock( &p_intf->change_lock ); |
|---|
| r2c595f3 |
r36aca39 |
|
| 97 | 97 | } |
|---|
| 98 | 98 | |
|---|
| 99 | | if( intf_ShouldDie( p_intf ) ) |
|---|
| | 99 | if( !vlc_object_alive( p_intf ) ) |
|---|
| 100 | 100 | { |
|---|
| 101 | 101 | vlc_mutex_unlock( &p_intf->change_lock ); |
|---|