Changeset 6b42b421710760b88561364ecc585b93aee7790a

Show
Ignore:
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
  • include/vlc_main.h

    rcf82552 r6b42b42  
    4646    playlist_t            *p_playlist;       ///< playlist object 
    4747 
    48     void                 *p_stats_computer;  ///< Input thread computing stats (needs cleanup) 
    4948    global_stats_t       *p_stats;           ///< Global statistics 
    5049 
  • src/input/input.c

    r9df2848 r6b42b42  
    159159    if( p_input->p_libvlc->p_stats && !b_quick ) 
    160160    { 
     161        libvlc_priv_t *priv = libvlc_priv (p_input->p_libvlc); 
    161162        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; 
    166165        vlc_mutex_unlock( &p_input->p_libvlc->p_stats->lock ); 
    167166    } 
     
    780779            stats_ComputeInputStats( p_input, p_input->p->input.p_item->p_stats ); 
    781780            /* 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 ) 
    783782            { 
    784783                stats_ComputeGlobalStats( p_input->p_libvlc, 
    785                                      p_input->p_libvlc->p_stats ); 
     784                                          p_input->p_libvlc->p_stats ); 
    786785            } 
    787786        } 
     
    13461345        if( libvlc_stats (p_input) ) 
    13471346        { 
     1347            libvlc_priv_t *priv = libvlc_priv (p_input->p_libvlc); 
     1348 
    13481349            /* make sure we are up to date */ 
    13491350            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 ) 
    13511352            { 
    13521353                stats_ComputeGlobalStats( p_input->p_libvlc, 
    13531354                                          p_input->p_libvlc->p_stats ); 
    1354                 p_input->p_libvlc->p_stats_computer = NULL; 
     1355                priv->p_stats_computer = NULL; 
    13551356            } 
    13561357            CL_CO( read_bytes ); 
  • src/libvlc-common.c

    rcf82552 r6b42b42  
    723723    } 
    724724    vlc_mutex_init( &p_libvlc->p_stats->lock ); 
    725     p_libvlc->p_stats_computer = NULL; 
     725    priv->p_stats_computer = NULL; 
    726726 
    727727    /* Init the array that holds every input item */ 
  • src/libvlc.h

    rcf82552 r6b42b42  
    224224    bool               b_stats;     ///< Whether to collect stats 
    225225 
     226    void              *p_stats_computer;  ///< Input thread computing stats 
     227                                          /// (needs cleanup) 
     228 
    226229    module_t          *p_memcpy_module;  ///< Fast memcpy plugin used 
    227230    vlm_t             *p_vlm;  ///< VLM if created from libvlc-common.c