Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
46bcf2ee
Commit
46bcf2ee
authored
Jun 18, 2004
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a nasty memleak in ugly and linear resamplers when alloca is
unavaliable. Also swaped the score of these modules.
parent
1e37a8cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
modules/audio_filter/resampler/linear.c
modules/audio_filter/resampler/linear.c
+8
-4
modules/audio_filter/resampler/ugly.c
modules/audio_filter/resampler/ugly.c
+9
-4
No files found.
modules/audio_filter/resampler/linear.c
View file @
46bcf2ee
...
...
@@ -2,7 +2,7 @@
* linear.c : linear interpolation resampler
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id
: linear.c,v 1.11 2003/12/22 14:32:55 sam Exp
$
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
...
...
@@ -57,7 +57,7 @@ struct aout_filter_sys_t
*****************************************************************************/
vlc_module_begin
();
set_description
(
_
(
"audio filter for linear interpolation resampling"
)
);
set_capability
(
"audio filter"
,
2
);
set_capability
(
"audio filter"
,
5
);
set_callbacks
(
Create
,
Close
);
vlc_module_end
();
...
...
@@ -118,7 +118,7 @@ static void Close( vlc_object_t * p_this )
static
void
DoWork
(
aout_instance_t
*
p_aout
,
aout_filter_t
*
p_filter
,
aout_buffer_t
*
p_in_buf
,
aout_buffer_t
*
p_out_buf
)
{
float
*
p_in
,
*
p_out
=
(
float
*
)
p_out_buf
->
p_buffer
;
float
*
p_in
_orig
,
*
p_in
,
*
p_out
=
(
float
*
)
p_out_buf
->
p_buffer
;
float
*
p_prev_sample
=
(
float
*
)
p_filter
->
p_sys
->
p_prev_sample
;
int
i_nb_channels
=
aout_FormatNbChannels
(
&
p_filter
->
input
);
...
...
@@ -145,7 +145,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
#ifdef HAVE_ALLOCA
p_in
=
(
float
*
)
alloca
(
p_in_buf
->
i_nb_bytes
);
#else
p_in
=
(
float
*
)
malloc
(
p_in_buf
->
i_nb_bytes
);
p_in
_orig
=
p_in
=
(
float
*
)
malloc
(
p_in_buf
->
i_nb_bytes
);
#endif
if
(
p_in
==
NULL
)
{
...
...
@@ -226,4 +226,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out_buf
->
i_nb_bytes
=
p_out_buf
->
i_nb_samples
*
i_nb_channels
*
sizeof
(
int32_t
);
#ifndef HAVE_ALLOCA
free
(
p_in_orig
);
#endif
}
modules/audio_filter/resampler/ugly.c
View file @
46bcf2ee
...
...
@@ -2,7 +2,7 @@
* ugly.c : ugly resampler (changes pitch)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id
: ugly.c,v 1.9 2003/03/04 03:27:40 gbazin Exp
$
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -44,7 +44,7 @@ static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
*****************************************************************************/
vlc_module_begin
();
set_description
(
_
(
"audio filter for ugly resampling"
)
);
set_capability
(
"audio filter"
,
5
);
set_capability
(
"audio filter"
,
2
);
set_callbacks
(
Create
,
NULL
);
vlc_module_end
();
...
...
@@ -82,7 +82,7 @@ static int Create( vlc_object_t *p_this )
static
void
DoWork
(
aout_instance_t
*
p_aout
,
aout_filter_t
*
p_filter
,
aout_buffer_t
*
p_in_buf
,
aout_buffer_t
*
p_out_buf
)
{
int32_t
*
p_in
,
*
p_out
=
(
int32_t
*
)
p_out_buf
->
p_buffer
;
int32_t
*
p_in
_orig
,
*
p_in
,
*
p_out
=
(
int32_t
*
)
p_out_buf
->
p_buffer
;
unsigned
int
i_nb_channels
=
aout_FormatNbChannels
(
&
p_filter
->
input
);
unsigned
int
i_in_nb
=
p_in_buf
->
i_nb_samples
;
...
...
@@ -100,7 +100,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
#ifdef HAVE_ALLOCA
p_in
=
(
int32_t
*
)
alloca
(
p_in_buf
->
i_nb_bytes
);
#else
p_in
=
(
int32_t
*
)
malloc
(
p_in_buf
->
i_nb_bytes
);
p_in
_orig
=
p_in
=
(
int32_t
*
)
malloc
(
p_in_buf
->
i_nb_bytes
);
#endif
if
(
p_in
==
NULL
)
{
...
...
@@ -131,4 +131,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out_buf
->
start_date
=
p_in_buf
->
start_date
;
p_out_buf
->
end_date
=
p_out_buf
->
start_date
+
p_out_buf
->
i_nb_samples
*
1000000
/
p_filter
->
output
.
i_rate
;
#ifndef HAVE_ALLOCA
free
(
p_in_orig
);
#endif
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment