Changeset 2b5eb3185ecd05444ce310ec33e0fdc0e5e69c90
- Timestamp:
- 05/07/08 20:37:29
(2 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1210185449 +0300
- git-parent:
[77bea3492049ad6989b04779d259fa27ed72a2e9]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1210185449 +0300
- Message:
Don't reregister the same callbacks over and over again
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd1aff39 |
r2b5eb31 |
|
| 109 | 109 | |
|---|
| 110 | 110 | static void start_color_and_pairs ( intf_thread_t * ); |
|---|
| | 111 | static playlist_t *pl_Get( intf_thread_t *p_intf ) |
|---|
| | 112 | { |
|---|
| | 113 | return p_intf->p_sys->p_playlist; |
|---|
| | 114 | } |
|---|
| 111 | 115 | |
|---|
| 112 | 116 | /***************************************************************************** |
|---|
| … | … | |
| 181 | 185 | { |
|---|
| 182 | 186 | input_thread_t *p_input; |
|---|
| | 187 | playlist_t *p_playlist; |
|---|
| 183 | 188 | |
|---|
| 184 | 189 | bool b_color; |
|---|
| … | … | |
| 336 | 341 | intf_thread_t *p_intf = (intf_thread_t *)p_this; |
|---|
| 337 | 342 | intf_sys_t *p_sys = p_intf->p_sys; |
|---|
| 338 | | playlist_t *p_playlist = pl_Get( p_intf ); |
|---|
| 339 | 343 | int i; |
|---|
| 340 | | |
|---|
| 341 | | var_DelCallback( p_playlist, "intf-change", PlaylistChanged, p_intf ); |
|---|
| 342 | | var_DelCallback( p_playlist, "item-append", PlaylistChanged, p_intf ); |
|---|
| 343 | 344 | |
|---|
| 344 | 345 | PlaylistDestroy( p_intf ); |
|---|
| … | … | |
| 385 | 386 | intf_sys_t *p_sys = p_intf->p_sys; |
|---|
| 386 | 387 | playlist_t *p_playlist = pl_Yield( p_intf ); |
|---|
| | 388 | p_sys->p_playlist = p_playlist; |
|---|
| 387 | 389 | |
|---|
| 388 | 390 | int i_key; |
|---|
| … | … | |
| 397 | 399 | */ |
|---|
| 398 | 400 | PlaylistRebuild( p_intf ); |
|---|
| | 401 | var_AddCallback( p_playlist, "intf-change", PlaylistChanged, p_intf ); |
|---|
| | 402 | var_AddCallback( p_playlist, "item-append", PlaylistChanged, p_intf ); |
|---|
| 399 | 403 | |
|---|
| 400 | 404 | while( !intf_ShouldDie( p_intf ) ) |
|---|
| … | … | |
| 403 | 407 | |
|---|
| 404 | 408 | /* Update the input */ |
|---|
| 405 | | var_AddCallback( p_playlist, "intf-change", PlaylistChanged, p_intf ); |
|---|
| 406 | | var_AddCallback( p_playlist, "item-append", PlaylistChanged, p_intf ); |
|---|
| 407 | | |
|---|
| 408 | 409 | PL_LOCK; |
|---|
| 409 | 410 | if( p_sys->p_input == NULL ) |
|---|
| … | … | |
| 459 | 460 | } |
|---|
| 460 | 461 | } |
|---|
| | 462 | var_DelCallback( p_playlist, "intf-change", PlaylistChanged, p_intf ); |
|---|
| | 463 | var_DelCallback( p_playlist, "item-append", PlaylistChanged, p_intf ); |
|---|
| 461 | 464 | } |
|---|
| 462 | 465 | |
|---|