Changeset 6b42b421710760b88561364ecc585b93aee7790a
- Timestamp:
- 05/04/08 20:36:25
(3 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1209926185 +0300
- git-parent:
[067e6c3763b1b6755993cf7aeea52be2701d299b]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1209926185 +0300
- Message:
Privatize the stats computer
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rcf82552 |
r6b42b42 |
|
| 46 | 46 | playlist_t *p_playlist; ///< playlist object |
|---|
| 47 | 47 | |
|---|
| 48 | | void *p_stats_computer; ///< Input thread computing stats (needs cleanup) |
|---|
| 49 | 48 | global_stats_t *p_stats; ///< Global statistics |
|---|
| 50 | 49 | |
|---|
| r9df2848 |
r6b42b42 |
|
| 159 | 159 | if( p_input->p_libvlc->p_stats && !b_quick ) |
|---|
| 160 | 160 | { |
|---|
| | 161 | libvlc_priv_t *priv = libvlc_priv (p_input->p_libvlc); |
|---|
| 161 | 162 | vlc_mutex_lock( &p_input->p_libvlc->p_stats->lock ); |
|---|
| 162 | | if( p_input->p_libvlc->p_stats_computer == NULL ) |
|---|
| 163 | | { |
|---|
| 164 | | p_input->p_libvlc->p_stats_computer = p_input; |
|---|
| 165 | | } |
|---|
| | 163 | if( priv->p_stats_computer == NULL ) |
|---|
| | 164 | priv->p_stats_computer = p_input; |
|---|
| 166 | 165 | vlc_mutex_unlock( &p_input->p_libvlc->p_stats->lock ); |
|---|
| 167 | 166 | } |
|---|
| … | … | |
| 780 | 779 | stats_ComputeInputStats( p_input, p_input->p->input.p_item->p_stats ); |
|---|
| 781 | 780 | /* Are we the thread responsible for computing global stats ? */ |
|---|
| 782 | | if( p_input->p_libvlc->p_stats_computer == p_input ) |
|---|
| | 781 | if( libvlc_priv (p_input->p_libvlc)->p_stats_computer == p_input ) |
|---|
| 783 | 782 | { |
|---|
| 784 | 783 | stats_ComputeGlobalStats( p_input->p_libvlc, |
|---|
| 785 | | p_input->p_libvlc->p_stats ); |
|---|
| | 784 | p_input->p_libvlc->p_stats ); |
|---|
| 786 | 785 | } |
|---|
| 787 | 786 | } |
|---|
| … | … | |
| 1346 | 1345 | if( libvlc_stats (p_input) ) |
|---|
| 1347 | 1346 | { |
|---|
| | 1347 | libvlc_priv_t *priv = libvlc_priv (p_input->p_libvlc); |
|---|
| | 1348 | |
|---|
| 1348 | 1349 | /* make sure we are up to date */ |
|---|
| 1349 | 1350 | stats_ComputeInputStats( p_input, p_input->p->input.p_item->p_stats ); |
|---|
| 1350 | | if( p_input->p_libvlc->p_stats_computer == p_input ) |
|---|
| | 1351 | if( priv->p_stats_computer == p_input ) |
|---|
| 1351 | 1352 | { |
|---|
| 1352 | 1353 | stats_ComputeGlobalStats( p_input->p_libvlc, |
|---|
| 1353 | 1354 | p_input->p_libvlc->p_stats ); |
|---|
| 1354 | | p_input->p_libvlc->p_stats_computer = NULL; |
|---|
| | 1355 | priv->p_stats_computer = NULL; |
|---|
| 1355 | 1356 | } |
|---|
| 1356 | 1357 | CL_CO( read_bytes ); |
|---|
| rcf82552 |
r6b42b42 |
|
| 723 | 723 | } |
|---|
| 724 | 724 | vlc_mutex_init( &p_libvlc->p_stats->lock ); |
|---|
| 725 | | p_libvlc->p_stats_computer = NULL; |
|---|
| | 725 | priv->p_stats_computer = NULL; |
|---|
| 726 | 726 | |
|---|
| 727 | 727 | /* Init the array that holds every input item */ |
|---|
| rcf82552 |
r6b42b42 |
|
| 224 | 224 | bool b_stats; ///< Whether to collect stats |
|---|
| 225 | 225 | |
|---|
| | 226 | void *p_stats_computer; ///< Input thread computing stats |
|---|
| | 227 | /// (needs cleanup) |
|---|
| | 228 | |
|---|
| 226 | 229 | module_t *p_memcpy_module; ///< Fast memcpy plugin used |
|---|
| 227 | 230 | vlm_t *p_vlm; ///< VLM if created from libvlc-common.c |
|---|