Changeset 4f6b904c37e1f62109e46f8d16bb2d801435d4c1
- Timestamp:
- 10/06/07 21:53:00
(1 year ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1181505180 +0000
- git-parent:
[ba9cf795c46e27566149aa0ae096221e9924e6d2]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1181505180 +0000
- Message:
Simplify + fix a potential overflow.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r21e5b32 |
r4f6b904 |
|
| 342 | 342 | |
|---|
| 343 | 343 | p_buffer->end_date = p_buffer->start_date |
|---|
| 344 | | + (mtime_t)(p_buffer->i_nb_samples * 1000000) |
|---|
| | 344 | + (mtime_t)p_buffer->i_nb_samples * 1000000 |
|---|
| 345 | 345 | / p_input->input.i_rate; |
|---|
| 346 | 346 | |
|---|
| r16db527 |
r4f6b904 |
|
| 45 | 45 | |
|---|
| 46 | 46 | static void inputFailure( aout_instance_t *, aout_input_t *, const char * ); |
|---|
| | 47 | static void inputDrop( aout_instance_t *, aout_input_t * ); |
|---|
| 47 | 48 | static int VisualizationCallback( vlc_object_t *, char const *, |
|---|
| 48 | 49 | vlc_value_t, vlc_value_t, void * ); |
|---|
| … | … | |
| 449 | 450 | } |
|---|
| 450 | 451 | start_date = 0; |
|---|
| 451 | | if( p_input->p_input_thread ) |
|---|
| 452 | | { |
|---|
| 453 | | vlc_mutex_lock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| 454 | | stats_UpdateInteger( p_aout, p_input->p_input_thread->p->counters.p_lost_abuffers, 1, NULL ); |
|---|
| 455 | | vlc_mutex_unlock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| 456 | | } |
|---|
| | 452 | inputDrop( p_aout, p_input ); |
|---|
| 457 | 453 | } |
|---|
| 458 | 454 | |
|---|
| … | … | |
| 463 | 459 | msg_Warn( p_aout, "PTS is out of range ("I64Fd"), dropping buffer", |
|---|
| 464 | 460 | mdate() - p_buffer->start_date ); |
|---|
| 465 | | if( p_input->p_input_thread ) |
|---|
| 466 | | { |
|---|
| 467 | | vlc_mutex_lock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| 468 | | stats_UpdateInteger( p_aout, p_input->p_input_thread->p->counters.p_lost_abuffers, 1, NULL ); |
|---|
| 469 | | vlc_mutex_unlock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| 470 | | } |
|---|
| | 461 | |
|---|
| | 462 | inputDrop( p_aout, p_input ); |
|---|
| 471 | 463 | aout_BufferFree( p_buffer ); |
|---|
| 472 | 464 | p_input->i_resampling_type = AOUT_RESAMPLING_NONE; |
|---|
| … | … | |
| 506 | 498 | start_date - p_buffer->start_date ); |
|---|
| 507 | 499 | aout_BufferFree( p_buffer ); |
|---|
| 508 | | if( p_input->p_input_thread ) |
|---|
| 509 | | { |
|---|
| 510 | | vlc_mutex_lock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| 511 | | stats_UpdateInteger( p_aout, p_input->p_input_thread->p->counters.p_lost_abuffers, 1, NULL ); |
|---|
| 512 | | vlc_mutex_unlock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| 513 | | } |
|---|
| | 500 | inputDrop( p_aout, p_input ); |
|---|
| 514 | 501 | return 0; |
|---|
| 515 | 502 | } |
|---|
| … | … | |
| 646 | 633 | } |
|---|
| 647 | 634 | |
|---|
| | 635 | static void inputDrop( aout_instance_t *p_aout, aout_input_t *p_input ) |
|---|
| | 636 | { |
|---|
| | 637 | if( !p_input->p_input_thread ) |
|---|
| | 638 | return; |
|---|
| | 639 | |
|---|
| | 640 | vlc_mutex_lock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| | 641 | stats_UpdateInteger( p_aout, p_input->p_input_thread->p->counters.p_lost_abuffers, 1, NULL ); |
|---|
| | 642 | vlc_mutex_unlock( &p_input->p_input_thread->p->counters.counters_lock); |
|---|
| | 643 | } |
|---|
| | 644 | |
|---|
| 648 | 645 | static int ChangeFiltersString( aout_instance_t * p_aout, const char* psz_variable, |
|---|
| 649 | 646 | const char *psz_name, vlc_bool_t b_add ) |
|---|