Changeset 2c0d24bf92307956113ce19b3d278327e0729dd4
- Timestamp:
- 10/12/02 22:55:01
(6 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1039557301 +0000
- git-parent:
[05b378dd459f5cee10755dcacaad794e53fa4be7]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1039557301 +0000
- Message:
* src/audio_output/filters.c: fix for resampler buffer size.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1b7ce26 |
r2c0d24b |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002 VideoLAN |
|---|
| 5 | | * $Id: filters.c,v 1.15 2002/12/06 10:10:39 sam Exp $ |
|---|
| | 5 | * $Id: filters.c,v 1.16 2002/12/10 21:55:01 gbazin Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Christophe Massiot <massiot@via.ecp.fr> |
|---|
| … | … | |
| 299 | 299 | aout_buffer_t * p_output_buffer; |
|---|
| 300 | 300 | |
|---|
| 301 | | /* We need this because resamplers can produce more samples than |
|---|
| 302 | | (i_in_nb * p_filter->output.i_rate / p_filter->input.i_rate) */ |
|---|
| 303 | | int i_compensate_rounding = 2 * p_filter->input.i_rate |
|---|
| 304 | | / p_filter->output.i_rate; |
|---|
| 305 | | |
|---|
| | 301 | /* Resamplers can produce slightly more samples than (i_in_nb * |
|---|
| | 302 | * p_filter->output.i_rate / p_filter->input.i_rate) so we need |
|---|
| | 303 | * slightly bigger buffers. */ |
|---|
| 306 | 304 | aout_BufferAlloc( &p_filter->output_alloc, |
|---|
| 307 | | ((mtime_t)(*pp_input_buffer)->i_nb_samples + i_compensate_rounding) |
|---|
| | 305 | ((mtime_t)(*pp_input_buffer)->i_nb_samples + 2) |
|---|
| 308 | 306 | * 1000000 / p_filter->input.i_rate, |
|---|
| 309 | 307 | *pp_input_buffer, p_output_buffer ); |
|---|