Changeset ac15b24be029a27ca7bdec62dc740c72c2ddaee0
- Timestamp:
- 19/08/08 22:24:52
(4 months ago)
- Author:
- Rémi Duraffort <ivoire@videolan.org>
- git-committer:
- Rémi Duraffort <ivoire@videolan.org> 1219177492 +0200
- git-parent:
[98ea2ba6901b56eea1e518ded8ad5779b6d040d4]
- git-author:
- Rémi Duraffort <ivoire@videolan.org> 1219177131 +0200
- Message:
Don't call mdate too many times.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r6dd5c5c |
rac15b24 |
|
| 436 | 436 | static void DoRRD( intf_thread_t *p_intf ) |
|---|
| 437 | 437 | { |
|---|
| 438 | | if( mdate() - p_intf->p_sys->last_update < 1000000 ) |
|---|
| | 438 | mtime_t now = mdate(); |
|---|
| | 439 | if( now - p_intf->p_sys->last_update < 1000000 ) |
|---|
| 439 | 440 | return; |
|---|
| 440 | | p_intf->p_sys->last_update = mdate(); |
|---|
| | 441 | p_intf->p_sys->last_update = now; |
|---|
| 441 | 442 | |
|---|
| 442 | 443 | if( p_intf->p_libvlc->p_stats ) |
|---|
| rd11fd0d |
rac15b24 |
|
| 821 | 821 | |
|---|
| 822 | 822 | /* Compute the average period */ |
|---|
| 823 | | p_announce->i_period = (p_announce->i_period + (mdate() - p_announce->i_last)) / 2; |
|---|
| 824 | | p_announce->i_last = mdate(); |
|---|
| | 823 | mtime_t now = mdate(); |
|---|
| | 824 | p_announce->i_period = (p_announce->i_period + (now - p_announce->i_last)) / 2; |
|---|
| | 825 | p_announce->i_last = now; |
|---|
| 825 | 826 | } |
|---|
| 826 | 827 | FreeSDP( p_sdp ); p_sdp = NULL; |
|---|
| r0f7394a |
rac15b24 |
|
| 249 | 249 | p_thread->psz_title = NULL; |
|---|
| 250 | 250 | |
|---|
| | 251 | mtime_t now = mdate(); |
|---|
| 251 | 252 | if (++count%100==0) |
|---|
| 252 | 253 | { |
|---|
| 253 | | realfps=100/((mdate()/1000-fpsstart)/1000); |
|---|
| | 254 | realfps=100/((now/1000-fpsstart)/1000); |
|---|
| 254 | 255 | // printf("%f\n",realfps); |
|---|
| 255 | | fpsstart=mdate()/1000; |
|---|
| | 256 | fpsstart=now/1000; |
|---|
| 256 | 257 | } |
|---|
| 257 | 258 | //framerate limiter |
|---|
| 258 | | timed=mspf-(mdate()/1000-timestart); |
|---|
| | 259 | timed=mspf-(now/1000-timestart); |
|---|
| 259 | 260 | // printf("%d,%d\n",time,mspf); |
|---|
| 260 | 261 | if (timed>0) msleep(1000*timed); |
|---|
| rd666030 |
rac15b24 |
|
| 514 | 514 | { |
|---|
| 515 | 515 | counter_sample_t *p_new, *p_old; |
|---|
| 516 | | if( mdate() - p_counter->last_update < p_counter->update_interval ) |
|---|
| | 516 | mtime_t now = mdate(); |
|---|
| | 517 | if( now - p_counter->last_update < p_counter->update_interval ) |
|---|
| 517 | 518 | { |
|---|
| 518 | 519 | return VLC_EGENERIC; |
|---|
| 519 | 520 | } |
|---|
| 520 | | p_counter->last_update = mdate(); |
|---|
| | 521 | p_counter->last_update = now; |
|---|
| 521 | 522 | if( p_counter->i_type != VLC_VAR_FLOAT && |
|---|
| 522 | 523 | p_counter->i_type != VLC_VAR_INTEGER ) |
|---|