Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
faceb389
Commit
faceb389
authored
Mar 05, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/audio_filter/resampler/bandlimited.c: added a few more sanity checks.
parent
2ede5551
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
modules/audio_filter/resampler/bandlimited.c
modules/audio_filter/resampler/bandlimited.c
+22
-4
No files found.
modules/audio_filter/resampler/bandlimited.c
View file @
faceb389
...
...
@@ -2,7 +2,7 @@
* bandlimited.c : bandlimited interpolation resampler
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: bandlimited.c,v 1.
3 2003/03/04 22:08:33
gbazin Exp $
* $Id: bandlimited.c,v 1.
4 2003/03/05 19:31:32
gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -255,10 +255,10 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
d_scale_factor
=
SMALL_FILTER_SCALE
*
d_factor
+
0
.
5
;
/* Apply the old rate until we have enough samples for the new one */
/* TODO: Check we have enough samples */
i_in
=
p_filter
->
p_sys
->
i_old_wing
;
p_in
+=
p_filter
->
p_sys
->
i_old_wing
*
i_nb_channels
;
for
(
;
i_in
<
i_filter_wing
;
i_in
++
)
for
(
;
i_in
<
i_filter_wing
&&
(
i_in
+
p_filter
->
p_sys
->
i_old_wing
)
<
i_in_nb
;
i_in
++
)
{
if
(
p_filter
->
p_sys
->
d_old_factor
==
1
)
{
...
...
@@ -299,6 +299,16 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
*(p_out+i) *= d_old_scale_factor;
}
#endif
/* Sanity check */
if
(
p_out_buf
->
i_size
/
p_filter
->
input
.
i_bytes_per_frame
<=
(
unsigned
int
)
i_out
+
1
)
{
p_out
+=
i_nb_channels
;
i_out
++
;
p_filter
->
p_sys
->
i_remainder
+=
p_filter
->
input
.
i_rate
;
break
;
}
}
else
{
...
...
@@ -328,7 +338,6 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
/* Apply the new rate for the rest of the samples */
/* TODO: Check we have enough future samples for the new rate */
if
(
i_in
<
i_in_nb
-
i_filter_wing
)
{
p_filter
->
p_sys
->
i_old_rate
=
p_filter
->
input
.
i_rate
;
...
...
@@ -366,6 +375,15 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
*(p_out+i) *= d_old_scale_factor;
}
#endif
/* Sanity check */
if
(
p_out_buf
->
i_size
/
p_filter
->
input
.
i_bytes_per_frame
<=
(
unsigned
int
)
i_out
+
1
)
{
p_out
+=
i_nb_channels
;
i_out
++
;
p_filter
->
p_sys
->
i_remainder
+=
p_filter
->
input
.
i_rate
;
break
;
}
}
else
{
...
...
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