Changeset f501554a399ebfcf3a28673dc7ded7d6666203fb

Show
Ignore:
Timestamp:
03/10/02 20:56:10 (6 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 1033671370 +0000
git-parent:

[6dafa419846a89a815750f3de722d8d675699658]

git-author:
Sam Hocevar <sam@videolan.org> 1033671370 +0000
Message:
  • ./configure.ac.in: duplicated arguments to AM_INIT_AUTOMAKE to fix
    locales breakage.
  • ./src/libvlc.c: libvlc understands the VLC_VERBOSE environment variable,
    to be set between 0 and 4. Default value is 0 for a program using libvlc,
    but vlc sets it to 1 by default.
  • ./src/misc/configuration.c: -v now works the old way (-v, -vv, -vvv) as
    well as the new way (-v0, -v1, -v4). -v1 is the same as -v, and -v0 is
    the same as -q (quiet). Hope it's all understandable.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac.in

    r6dafa41 rf501554  
    1212dnl XXX: we don't put any flags here, because automake 1.5 doesn't support 
    1313dnl them. And we need the comma otherwize automake will choke on it. 
    14 AM_INIT_AUTOMAKE($PACKAGE, $VERSION
     14AM_INIT_AUTOMAKE(vlc,0.5.0-cvs-am
    1515AM_CONFIG_HEADER(config.h) 
    1616 
  • include/main.h

    r145b196 rf501554  
    44 ***************************************************************************** 
    55 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 
    6  * $Id: main.h,v 1.46 2002/10/03 13:21:54 sam Exp $ 
     6 * $Id: main.h,v 1.47 2002/10/03 18:56:09 sam Exp $ 
    77 * 
    88 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    3939    /* CPU extensions */ 
    4040    u32                    i_cpu; 
     41 
     42    /* Generic settings */ 
     43    int                    i_verbose;                       /* info messages */ 
     44    vlc_bool_t             b_color;                       /* color messages? */ 
    4145 
    4246    /* Object structure data */ 
     
    8690 
    8791    /* Generic settings */ 
    88     vlc_bool_t             b_quiet;                            /* be quiet ? */ 
    89     vlc_bool_t             b_verbose;                     /* info messages ? */ 
    90     vlc_bool_t             b_color;                      /* color messages ? */ 
    9192    mtime_t                i_desync;   /* relative desync of the audio ouput */ 
    92  
    93     /* CPU extensions (inherited from libvlc_t) */ 
    94     u32                    i_cpu; 
    9593 
    9694    /* Fast memcpy plugin used */ 
  • mozilla/vlcshell.cpp

    r2799d36 rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: vlcshell.cpp,v 1.2 2002/09/30 11:05:41 sam Exp $ 
     5 * $Id: vlcshell.cpp,v 1.3 2002/10/03 18:56:09 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    166166        , "--intf", "dummy" 
    167167        /*, "--noaudio"*/ 
    168         /*, "-q"*/ 
    169         , "-v" 
    170168    }; 
    171169 
  • src/audio_output/output.c

    r9a6b90b rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: output.c,v 1.16 2002/09/30 21:32:33 massiot Exp $ 
     5 * $Id: output.c,v 1.17 2002/10/03 18:56:09 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    5757        /* Non-S/PDIF mixer only deals with float32 or fixed32. */ 
    5858        p_aout->output.output.i_format 
    59                      = (p_aout->p_vlc->i_cpu & CPU_CAPABILITY_FPU) ? 
     59                     = (p_aout->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) ? 
    6060                        VLC_FOURCC('f','l','3','2') : 
    6161                        VLC_FOURCC('f','i','3','2'); 
     
    9494        /* Non-S/PDIF mixer only deals with float32 or fixed32. */ 
    9595        p_aout->mixer.mixer.i_format 
    96                      = (p_aout->p_vlc->i_cpu & CPU_CAPABILITY_FPU) ? 
     96                     = (p_aout->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) ? 
    9797                        VLC_FOURCC('f','l','3','2') : 
    9898                        VLC_FOURCC('f','i','3','2'); 
  • src/libvlc.c

    r145b196 rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2002 VideoLAN 
    5  * $Id: libvlc.c,v 1.34 2002/10/03 13:21:55 sam Exp $ 
     5 * $Id: libvlc.c,v 1.35 2002/10/03 18:56:09 sam Exp $ 
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    157157    if( !libvlc.b_ready ) 
    158158    { 
     159        char *psz_env; 
     160 
    159161        vlc_mutex_init( &libvlc, &libvlc.structure_lock ); 
    160162        libvlc.p_global_data = NULL; 
     
    163165        /* Guess what CPU we have */ 
    164166        libvlc.i_cpu = CPUCapabilities(); 
     167 
     168        /* Find verbosity from VLC_VERBOSE environment variable */ 
     169        psz_env = getenv( "VLC_VERBOSE" ); 
     170        libvlc.i_verbose = psz_env ? atoi( psz_env ) : 0; 
     171 
     172#ifdef HAVE_ISATTY 
     173        libvlc.b_color = isatty( 2 ); /* 2 is for stderr */ 
     174#else 
     175        libvlc.b_color = VLC_FALSE; 
     176#endif 
    165177 
    166178        /* Initialize message queue */ 
     
    188200 
    189201    p_vlc->psz_object_name = "root"; 
    190  
    191     p_vlc->b_verbose = VLC_TRUE; 
    192     p_vlc->b_quiet = VLC_FALSE; /* FIXME: delay message queue output! */ 
    193202 
    194203    /* Initialize mutexes */ 
     
    399408 
    400409    /* 
     410     * Message queue options 
     411     */ 
     412    if( config_GetInt( p_vlc, "quiet" ) ) 
     413    { 
     414        libvlc.i_verbose = 0; 
     415    } 
     416    else 
     417    { 
     418        int i_tmp = config_GetInt( p_vlc, "verbose" ); 
     419        if( i_tmp >= 0 && i_tmp <= 4 ) 
     420        { 
     421            libvlc.i_verbose = i_tmp; 
     422        } 
     423    } 
     424    libvlc.b_color = libvlc.b_color || config_GetInt( p_vlc, "color" ); 
     425 
     426    /* 
    401427     * Output messages that may still be in the queue 
    402428     */ 
    403     p_vlc->b_verbose = config_GetInt( p_vlc, "verbose" ); 
    404     p_vlc->b_quiet = config_GetInt( p_vlc, "quiet" ); 
    405     p_vlc->b_color = config_GetInt( p_vlc, "color" ); 
    406429    msg_Flush( p_vlc ); 
    407430 
     
    409432    p_vlc->i_desync = config_GetInt( p_vlc, "desync" ) * (mtime_t)1000; 
    410433 
    411     p_vlc->i_cpu = libvlc.i_cpu; 
    412  
    413434#if defined( __i386__ ) 
    414435    if( !config_GetInt( p_vlc, "mmx" ) ) 
    415         p_vlc->i_cpu &= ~CPU_CAPABILITY_MMX; 
     436        libvlc.i_cpu &= ~CPU_CAPABILITY_MMX; 
    416437    if( !config_GetInt( p_vlc, "3dn" ) ) 
    417         p_vlc->i_cpu &= ~CPU_CAPABILITY_3DNOW; 
     438        libvlc.i_cpu &= ~CPU_CAPABILITY_3DNOW; 
    418439    if( !config_GetInt( p_vlc, "mmxext" ) ) 
    419         p_vlc->i_cpu &= ~CPU_CAPABILITY_MMXEXT; 
     440        libvlc.i_cpu &= ~CPU_CAPABILITY_MMXEXT; 
    420441    if( !config_GetInt( p_vlc, "sse" ) ) 
    421         p_vlc->i_cpu &= ~CPU_CAPABILITY_SSE; 
     442        libvlc.i_cpu &= ~CPU_CAPABILITY_SSE; 
    422443#endif 
    423444#if defined( __powerpc__ ) || defined( SYS_DARWIN ) 
    424445    if( !config_GetInt( p_vlc, "altivec" ) ) 
    425         p_vlc->i_cpu &= ~CPU_CAPABILITY_ALTIVEC; 
     446        libvlc.i_cpu &= ~CPU_CAPABILITY_ALTIVEC; 
    426447#endif 
    427448 
    428449#define PRINT_CAPABILITY( capability, string )                              \ 
    429     if( p_vlc->i_cpu & capability )                                         \ 
     450    if( libvlc.i_cpu & capability )                                         \ 
    430451    {                                                                       \ 
    431452        strncat( p_capabilities, string " ",                                \ 
  • src/libvlc.h

    r2aac17a rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2002 VideoLAN 
    5  * $Id: libvlc.h,v 1.16 2002/10/01 22:29:09 massiot Exp $ 
     5 * $Id: libvlc.h,v 1.17 2002/10/03 18:56:09 sam Exp $ 
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    3838    "available.") 
    3939 
    40 #define VERBOSE_TEXT N_("be verbose") 
     40#define VERBOSE_TEXT N_("verbosity (0-4)") 
    4141#define VERBOSE_LONGTEXT N_( \ 
    42     "This options activates the output of information messages.") 
     42    "This options sets the verbosity level (0=no messages, 1=only errors, " \ 
     43    "4=max.") 
    4344 
    4445#define QUIET_TEXT N_("be quiet") 
     
    352353    add_module_with_short( "intf", 'I', "interface", NULL, NULL, 
    353354                           INTF_TEXT, INTF_LONGTEXT ); 
    354     add_bool_with_short( "verbose", 'v', 0, NULL, 
    355                          VERBOSE_TEXT, VERBOSE_LONGTEXT ); 
     355    add_integer_with_short( "verbose", 'v', -1, NULL, 
     356                            VERBOSE_TEXT, VERBOSE_LONGTEXT ); 
    356357    add_bool_with_short( "quiet", 'q', 0, NULL, QUIET_TEXT, QUIET_LONGTEXT ); 
    357358    add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT ); 
  • src/misc/configuration.c

    r1354358 rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: configuration.c,v 1.39 2002/09/29 18:19:53 sam Exp $ 
     5 * $Id: configuration.c,v 1.40 2002/10/03 18:56:09 sam Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    10441044                    psz_shortopts[i_shortopts] = ':'; 
    10451045                    i_shortopts++; 
     1046 
     1047                    if( p_item->i_short == 'v' ) 
     1048                    { 
     1049                        psz_shortopts[i_shortopts] = ':'; 
     1050                        i_shortopts++; 
     1051                    } 
    10461052                } 
    10471053            } 
     
    11081114                break; 
    11091115            case CONFIG_ITEM_INTEGER: 
    1110                 config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name, 
    1111                                        atoi(optarg)); 
     1116                if( i_cmd == 'v' ) 
     1117                { 
     1118                    int i_verbose = 0; 
     1119 
     1120                    if( optarg ) 
     1121                    { 
     1122                        if( *optarg == 'v' ) /* eg. -vvvvv */ 
     1123                        { 
     1124                            i_verbose++; 
     1125                            while( *optarg == 'v' ) 
     1126                            { 
     1127                                i_verbose++; 
     1128                                optarg++; 
     1129                            } 
     1130                        } 
     1131                        else 
     1132                        { 
     1133                            i_verbose += atoi( optarg ); /* eg. -v2 */ 
     1134                        } 
     1135                    } 
     1136                    else 
     1137                    { 
     1138                        i_verbose = 1; /* -v */ 
     1139                    } 
     1140                    config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name, 
     1141                                           i_verbose ); 
     1142                } 
     1143                else 
     1144                { 
     1145                    config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name, 
     1146                                           atoi(optarg) ); 
     1147                } 
    11121148                break; 
    11131149            case CONFIG_ITEM_BOOL: 
  • src/misc/messages.c

    r145b196 rf501554  
    55 ***************************************************************************** 
    66 * Copyright (C) 1998-2002 VideoLAN 
    7  * $Id: messages.c,v 1.11 2002/10/03 13:21:55 sam Exp $ 
     7 * $Id: messages.c,v 1.12 2002/10/03 18:56:09 sam Exp $ 
    88 * 
    99 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    436436    int i_type = p_item->i_type; 
    437437 
    438     if( /*p_this->p_vlc->b_quiet ||*/ !p_this->p_libvlc->msg_bank.b_configured ) 
    439     { 
    440         return; 
    441     } 
    442  
    443     if( /*!p_this->p_vlc->b_verbose && */ 
    444          ( (i_type == VLC_MSG_WARN) || (i_type == VLC_MSG_DBG) ) ) 
    445     { 
    446         return; 
     438    switch( i_type ) 
     439    { 
     440        case VLC_MSG_ERR: 
     441            if( p_this->p_libvlc->i_verbose < 1 ) return; 
     442            break; 
     443        case VLC_MSG_INFO: 
     444            if( p_this->p_libvlc->i_verbose < 2 ) return; 
     445            break; 
     446        case VLC_MSG_WARN: 
     447            if( p_this->p_libvlc->i_verbose < 3 ) return; 
     448            break; 
     449        case VLC_MSG_DBG: 
     450            if( p_this->p_libvlc->i_verbose < 4 ) return; 
     451            break; 
    447452    } 
    448453 
     
    463468 
    464469    /* Send the message to stderr */ 
    465     if( /*p_this->p_vlc->b_color*/1
     470    if( p_this->p_libvlc->b_color
    466471    { 
    467472        fprintf( stderr, "[" GREEN "%.6x" GRAY "] %s %s%s: %s%s" GRAY "\n", 
  • src/misc/modules.c

    r145b196 rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: modules.c,v 1.94 2002/10/03 13:21:55 sam Exp $ 
     5 * $Id: modules.c,v 1.95 2002/10/03 18:56:10 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    313313 
    314314        /* Test if we have the required CPU */ 
    315         if( (p_module->i_cpu & p_this->p_vlc->i_cpu) != p_module->i_cpu ) 
     315        if( (p_module->i_cpu & p_this->p_libvlc->i_cpu) != p_module->i_cpu ) 
    316316        { 
    317317            continue; 
  • src/misc/objects.c

    r145b196 rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: objects.c,v 1.21 2002/10/03 13:21:55 sam Exp $ 
     5 * $Id: objects.c,v 1.22 2002/10/03 18:56:10 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    448448        else 
    449449        { 
    450             vlc_object_t *p_me = p_this->p_vlc 
    451                                ? (vlc_object_t *)p_this->p_vlc 
    452                                : (vlc_object_t *)p_this->p_libvlc; 
    453             msg_Info( p_me, "o %.6x %s (not attached)", 
    454                       (*pp_current)->i_object_id, 
    455                       (*pp_current)->psz_object_type ); 
     450            printf( " o %.6x %s (not attached)\n", 
     451                    (*pp_current)->i_object_id, 
     452                    (*pp_current)->psz_object_type ); 
    456453        } 
    457454    } 
     
    650647{ 
    651648    char psz_children[20], psz_refcount[20], psz_thread[20], psz_name[50]; 
    652     vlc_object_t *p_me; 
    653649 
    654650    psz_name[0] = '\0'; 
     
    689685    } 
    690686 
    691     p_me = p_this->p_vlc ? (vlc_object_t *)p_this->p_vlc 
    692                          : (vlc_object_t *)p_this->p_libvlc; 
    693     msg_Info( p_me, "%so %.6x %s%s%s%s%s", psz_prefix, 
    694               p_this->i_object_id, p_this->psz_object_type, 
    695               psz_name, psz_thread, psz_refcount, psz_children ); 
     687    printf( " %so %.6x %s%s%s%s%s\n", psz_prefix, 
     688            p_this->i_object_id, p_this->psz_object_type, 
     689            psz_name, psz_thread, psz_refcount, psz_children ); 
    696690} 
    697691 
  • src/vlc.c

    r1354358 rf501554  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2001 VideoLAN 
    5  * $Id: vlc.c,v 1.11 2002/09/29 18:19:53 sam Exp $ 
     5 * $Id: vlc.c,v 1.12 2002/10/03 18:56:09 sam Exp $ 
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    5151    fprintf( stderr, COPYRIGHT_MESSAGE "\n" ); 
    5252 
    53 #ifdef SYS_LINUX 
     53#ifdef HAVE_PUTENV 
    5454#   ifdef DEBUG 
    5555    /* Activate malloc checking routines to detect heap corruptions. */ 
     
    5959    putenv( "GNOME_DISABLE_CRASH_DIALOG=1" ); 
    6060#   endif 
     61 
     62    /* If the user isn't using VLC_VERBOSE, set it to 1 by default */ 
     63    if( getenv( "VLC_VERBOSE" ) == NULL ) 
     64    { 
     65        putenv( "VLC_VERBOSE=1" ); 
     66    } 
    6167#endif 
    6268