Changeset 5827c899e99ce566ade8d4b149b7c02a0a75278f

Show
Ignore:
Timestamp:
14/01/06 11:57:44 (3 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1137236264 +0000
git-parent:

[e1935dc3b8ba57fa26f7b32221d051443424526d]

git-author:
Clément Stenac <zorglub@videolan.org> 1137236264 +0000
Message:

Add an option to disable stats (Refs:#473)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/main.h

    r2cb472d r5827c89  
    6060    /* The module bank */ 
    6161    module_bank_t *        p_module_bank; 
     62 
     63    /* Do stats ? - We keep this boolean to avoid unneeded lookups */ 
     64    vlc_bool_t             b_stats; 
    6265 
    6366    /* Arch-specific variables */ 
  • src/libvlc.c

    r2cb472d r5827c89  
    680680        p_vlc->pf_memset = memset; 
    681681    } 
     682 
     683    libvlc.b_stats = config_GetInt( p_vlc, "stats" ); 
    682684 
    683685    /* 
  • src/libvlc.h

    r2cb472d r5827c89  
    768768    "improve the start time of VLC.") 
    769769 
    770 #define DAEMON_TEXT N_("Run as daemon process") 
     770#define DAEMON_TEXT N_("Collect statistics") 
    771771#define DAEMON_LONGTEXT N_( \ 
     772     "This option allows you to collect miscellaneous statistics.") 
     773 
     774#define STATS_TEXT N_("Run as daemon process") 
     775#define STATS_LONGTEXT N_( \ 
    772776     "Runs VLC as a background daemon process.") 
    773777 
     
    13591363    add_string( "vlm-conf", NULL, NULL, VLM_CONF_TEXT, 
    13601364                    VLM_CONF_LONGTEXT, VLC_TRUE ); 
     1365 
     1366    add_bool ( "stats", VLC_TRUE, NULL, STATS_TEXT, STATS_LONGTEXT, VLC_TRUE ); 
    13611367 
    13621368#if !defined(WIN32) 
  • src/misc/stats.c

    r60c51db r5827c89  
    6060{ 
    6161    counter_t *p_counter; 
    62     stats_handler_t *p_handler = stats_HandlerGet( p_this ); 
     62    stats_handler_t *p_handler; 
     63 
     64    if( p_this->p_libvlc->b_stats == VLC_FALSE ) 
     65    { 
     66        return VLC_EGENERIC; 
     67    } 
     68    p_handler = stats_HandlerGet( p_this ); 
    6369    if( !p_handler ) return VLC_ENOMEM; 
    6470 
     
    99105 
    100106    /* Get stats handler singleton */ 
    101     stats_handler_t *p_handler = stats_HandlerGet( p_this ); 
     107    stats_handler_t *p_handler; 
     108    if( p_this->p_libvlc->b_stats == VLC_FALSE ) 
     109    { 
     110        return VLC_EGENERIC; 
     111    } 
     112    p_handler = stats_HandlerGet( p_this ); 
    102113    if( !p_handler ) return VLC_ENOMEM; 
    103114 
     
    133144 
    134145    /* Get stats handler singleton */ 
    135     stats_handler_t *p_handler = stats_HandlerGet( p_this ); 
     146    stats_handler_t *p_handler; 
     147    if( p_this->p_libvlc->b_stats == VLC_FALSE ) 
     148    { 
     149        return VLC_EGENERIC; 
     150    } 
     151    p_handler = stats_HandlerGet( p_this ); 
    136152    if( !p_handler ) return VLC_ENOMEM; 
    137153    vlc_mutex_lock( &p_handler->object_lock ); 
     
    206222    counter_t *p_counter; 
    207223 
    208     /* Get stats handler singleton */ 
    209     stats_handler_t *p_handler = stats_HandlerGet( p_this ); 
     224    stats_handler_t *p_handler; 
     225    if( p_this->p_libvlc->b_stats == VLC_FALSE ) 
     226    { 
     227        return NULL; 
     228    } 
     229    p_handler = stats_HandlerGet( p_this ); 
    210230    if( !p_handler ) return NULL; 
    211231 
  • src/playlist/playlist.c

    r2cb472d r5827c89  
    582582    mtime_t    i_sout_destroyed_date = 0; 
    583583 
    584     int i_loops
     584    int i_loops = 0
    585585 
    586586    playlist_item_t *p_autodelete_item = NULL; 
     
    626626                stats_ComputeInputStats( p_playlist->p_input, 
    627627                                  p_playlist->p_input->input.p_item->p_stats ); 
    628 //                stats_DumpInputStats( 
    629 //                             p_playlist->p_input->input.p_item->p_stats ); 
     628 //               stats_DumpInputStats( 
     629 //                            p_playlist->p_input->input.p_item->p_stats ); 
    630630            } 
    631631