Changeset 6076147519aed12d89cf3957b30cba9eae2505f8
- 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
| r733a686 |
r6076147 |
|
| 75 | 75 | text_style_t *p_style; /* font control */ |
|---|
| 76 | 76 | |
|---|
| 77 | | time_t last_time; |
|---|
| | 77 | mtime_t last_time; |
|---|
| | 78 | mtime_t i_refresh; |
|---|
| 78 | 79 | |
|---|
| 79 | 80 | vlc_bool_t b_need_update; |
|---|
| … | … | |
| 105 | 106 | "displayed. Default value is " \ |
|---|
| 106 | 107 | "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.") |
|---|
| 107 | 112 | #define OPACITY_TEXT N_("Opacity") |
|---|
| 108 | 113 | #define OPACITY_LONGTEXT N_("Opacity (inverse of transparency) of " \ |
|---|
| … | … | |
| 162 | 167 | add_integer( CFG_PREFIX "timeout", 0, NULL, TIMEOUT_TEXT, TIMEOUT_LONGTEXT, |
|---|
| 163 | 168 | VLC_FALSE ); |
|---|
| | 169 | add_integer( CFG_PREFIX "refresh", 1000, NULL, REFRESH_TEXT, |
|---|
| | 170 | REFRESH_LONGTEXT, VLC_FALSE ); |
|---|
| 164 | 171 | |
|---|
| 165 | 172 | set_description( _("Marquee display") ); |
|---|
| … | … | |
| 175 | 182 | |
|---|
| 176 | 183 | static 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 |
|---|
| 178 | 186 | }; |
|---|
| 179 | 187 | |
|---|
| … | … | |
| 207 | 215 | CREATE_VAR( i_yoff, Integer, "marq-y" ); |
|---|
| 208 | 216 | CREATE_VAR( i_timeout,Integer, "marq-timeout" ); |
|---|
| | 217 | CREATE_VAR( i_refresh,Integer, "marq-refresh" ); |
|---|
| 209 | 218 | CREATE_VAR( i_pos, Integer, "marq-position" ); |
|---|
| 210 | 219 | CREATE_VAR( psz_marquee, String, "marq-marquee" ); |
|---|
| … | … | |
| 217 | 226 | /* Misc init */ |
|---|
| 218 | 227 | p_filter->pf_sub_filter = Filter; |
|---|
| 219 | | p_sys->last_time = ((time_t)-1); |
|---|
| | 228 | p_sys->last_time = 0; |
|---|
| 220 | 229 | p_sys->b_need_update = VLC_TRUE; |
|---|
| 221 | 230 | |
|---|
| … | … | |
| 259 | 268 | subpicture_t *p_spu; |
|---|
| 260 | 269 | 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 ) |
|---|
| 264 | 272 | { |
|---|
| 265 | 273 | return NULL; |
|---|
| … | … | |
| 287 | 295 | } |
|---|
| 288 | 296 | |
|---|
| 289 | | t = p_sys->last_time = time( NULL ); |
|---|
| | 297 | p_sys->last_time = date; |
|---|
| 290 | 298 | |
|---|
| 291 | 299 | if( strchr( p_sys->psz_marquee, '%' ) || strchr( p_sys->psz_marquee, '$' ) ) |
|---|
| … | … | |
| 361 | 369 | p_sys->i_timeout = newval.i_int; |
|---|
| 362 | 370 | } |
|---|
| | 371 | else if ( !strncmp( psz_var, "marq-refresh", 12 ) ) |
|---|
| | 372 | { |
|---|
| | 373 | p_sys->i_refresh = newval.i_int; |
|---|
| | 374 | } |
|---|
| 363 | 375 | else if ( !strncmp( psz_var, "marq-position", 8 ) ) |
|---|
| 364 | 376 | /* willing to accept a match against marq-pos */ |
|---|