Changeset 46bcf2ee7c86c33dba989a3e131852319fb72bda
- Timestamp:
- 18/06/04 14:38:28
(4 years ago)
- Author:
- Sigmund Augdal Helberg <sigmunau@videolan.org>
- git-committer:
- Sigmund Augdal Helberg <sigmunau@videolan.org> 1087562308 +0000
- git-parent:
[1e37a8cbae4a8d79f390ab393fdb9141e508b733]
- git-author:
- Sigmund Augdal Helberg <sigmunau@videolan.org> 1087562308 +0000
- Message:
Fixed a nasty memleak in ugly and linear resamplers when alloca is
unavaliable. Also swaped the score of these modules.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5ca0ebc |
r46bcf2e |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002 VideoLAN |
|---|
| 5 | | * $Id: linear.c,v 1.11 2003/12/22 14:32:55 sam Exp $ |
|---|
| | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| … | … | |
| 58 | 58 | vlc_module_begin(); |
|---|
| 59 | 59 | set_description( _("audio filter for linear interpolation resampling") ); |
|---|
| 60 | | set_capability( "audio filter", 2 ); |
|---|
| | 60 | set_capability( "audio filter", 5 ); |
|---|
| 61 | 61 | set_callbacks( Create, Close ); |
|---|
| 62 | 62 | vlc_module_end(); |
|---|
| … | … | |
| 119 | 119 | aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf ) |
|---|
| 120 | 120 | { |
|---|
| 121 | | float *p_in, *p_out = (float *)p_out_buf->p_buffer; |
|---|
| | 121 | float *p_in_orig, *p_in, *p_out = (float *)p_out_buf->p_buffer; |
|---|
| 122 | 122 | float *p_prev_sample = (float *)p_filter->p_sys->p_prev_sample; |
|---|
| 123 | 123 | |
|---|
| … | … | |
| 146 | 146 | p_in = (float *)alloca( p_in_buf->i_nb_bytes ); |
|---|
| 147 | 147 | #else |
|---|
| 148 | | p_in = (float *)malloc( p_in_buf->i_nb_bytes ); |
|---|
| | 148 | p_in_orig = p_in = (float *)malloc( p_in_buf->i_nb_bytes ); |
|---|
| 149 | 149 | #endif |
|---|
| 150 | 150 | if( p_in == NULL ) |
|---|
| … | … | |
| 227 | 227 | i_nb_channels * sizeof(int32_t); |
|---|
| 228 | 228 | |
|---|
| | 229 | #ifndef HAVE_ALLOCA |
|---|
| | 230 | free( p_in_orig ); |
|---|
| | 231 | #endif |
|---|
| | 232 | |
|---|
| 229 | 233 | } |
|---|
| r75426e2 |
r46bcf2e |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002 VideoLAN |
|---|
| 5 | | * $Id: ugly.c,v 1.9 2003/03/04 03:27:40 gbazin Exp $ |
|---|
| | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 45 | 45 | vlc_module_begin(); |
|---|
| 46 | 46 | set_description( _("audio filter for ugly resampling") ); |
|---|
| 47 | | set_capability( "audio filter", 5 ); |
|---|
| | 47 | set_capability( "audio filter", 2 ); |
|---|
| 48 | 48 | set_callbacks( Create, NULL ); |
|---|
| 49 | 49 | vlc_module_end(); |
|---|
| … | … | |
| 83 | 83 | aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf ) |
|---|
| 84 | 84 | { |
|---|
| 85 | | int32_t *p_in, *p_out = (int32_t*)p_out_buf->p_buffer; |
|---|
| | 85 | int32_t *p_in_orig, *p_in, *p_out = (int32_t*)p_out_buf->p_buffer; |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | unsigned int i_nb_channels = aout_FormatNbChannels( &p_filter->input ); |
|---|
| … | … | |
| 101 | 101 | p_in = (int32_t *)alloca( p_in_buf->i_nb_bytes ); |
|---|
| 102 | 102 | #else |
|---|
| 103 | | p_in = (int32_t *)malloc( p_in_buf->i_nb_bytes ); |
|---|
| | 103 | p_in_orig = p_in = (int32_t *)malloc( p_in_buf->i_nb_bytes ); |
|---|
| 104 | 104 | #endif |
|---|
| 105 | 105 | if( p_in == NULL ) |
|---|
| … | … | |
| 132 | 132 | p_out_buf->end_date = p_out_buf->start_date + p_out_buf->i_nb_samples * |
|---|
| 133 | 133 | 1000000 / p_filter->output.i_rate; |
|---|
| | 134 | |
|---|
| | 135 | #ifndef HAVE_ALLOCA |
|---|
| | 136 | free( p_in_orig ); |
|---|
| | 137 | #endif |
|---|
| | 138 | |
|---|
| 134 | 139 | } |
|---|