Changeset 6076147519aed12d89cf3957b30cba9eae2505f8

Show
Ignore:
Timestamp:
28/02/08 23:20:10 (9 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1204237210 +0000
git-parent:

[feef533df91d4ce904da75634e5638eb7375a371]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1204237210 +0000
Message:

Add a --marq-refresh option to specify the format string refresh period in ms. Core statistics are only refreshed every 1 sec (see src/input/input.c) so we'll need some changes to the core if we want sub-second updates of stats data.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/video_filter/marq.c

    r733a686 r6076147  
    7575    text_style_t *p_style; /* font control */ 
    7676 
    77     time_t last_time; 
     77    mtime_t last_time; 
     78    mtime_t i_refresh; 
    7879 
    7980    vlc_bool_t b_need_update; 
     
    105106                            "displayed. Default value is " \ 
    106107                            "0 (remains forever).") 
     108#define REFRESH_TEXT N_("Refresh period in ms") 
     109#define REFRESH_LONGTEXT N_("Number of milliseconds between string updates. " \ 
     110                            "This is mainly usefull when using meta data " \ 
     111                            "or time format string sequences.") 
    107112#define OPACITY_TEXT N_("Opacity") 
    108113#define OPACITY_LONGTEXT N_("Opacity (inverse of transparency) of " \ 
     
    162167    add_integer( CFG_PREFIX "timeout", 0, NULL, TIMEOUT_TEXT, TIMEOUT_LONGTEXT, 
    163168                 VLC_FALSE ); 
     169    add_integer( CFG_PREFIX "refresh", 1000, NULL, REFRESH_TEXT, 
     170                 REFRESH_LONGTEXT, VLC_FALSE ); 
    164171 
    165172    set_description( _("Marquee display") ); 
     
    175182 
    176183static const char *ppsz_filter_options[] = { 
    177     "marquee", "x", "y", "position", "color", "size", "timeout", NULL 
     184    "marquee", "x", "y", "position", "color", "size", "timeout", "refresh", 
     185    NULL 
    178186}; 
    179187 
     
    207215    CREATE_VAR( i_yoff, Integer, "marq-y" ); 
    208216    CREATE_VAR( i_timeout,Integer, "marq-timeout" ); 
     217    CREATE_VAR( i_refresh,Integer, "marq-refresh" ); 
    209218    CREATE_VAR( i_pos, Integer, "marq-position" ); 
    210219    CREATE_VAR( psz_marquee, String, "marq-marquee" ); 
     
    217226    /* Misc init */ 
    218227    p_filter->pf_sub_filter = Filter; 
    219     p_sys->last_time = ((time_t)-1)
     228    p_sys->last_time = 0
    220229    p_sys->b_need_update = VLC_TRUE; 
    221230 
     
    259268    subpicture_t *p_spu; 
    260269    video_format_t fmt; 
    261     time_t t; 
    262  
    263     if( p_sys->last_time == time( NULL ) ) 
     270 
     271    if( p_sys->last_time + p_sys->i_refresh*1000 > date ) 
    264272    { 
    265273        return NULL; 
     
    287295    } 
    288296 
    289     t = p_sys->last_time = time( NULL )
     297    p_sys->last_time = date
    290298 
    291299    if( strchr( p_sys->psz_marquee, '%' ) || strchr( p_sys->psz_marquee, '$' ) ) 
     
    361369        p_sys->i_timeout = newval.i_int; 
    362370    } 
     371    else if ( !strncmp( psz_var, "marq-refresh", 12 ) ) 
     372    { 
     373        p_sys->i_refresh = newval.i_int; 
     374    } 
    363375    else if ( !strncmp( psz_var, "marq-position", 8 ) ) 
    364376    /* willing to accept a match against marq-pos */