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
33913b06
Commit
33913b06
authored
Aug 24, 2002
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./modules/audio_filter/resampler/trivial.c: fixed a buffer size calculation
issue in the trivial resampler.
parent
f02ba9de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
modules/audio_filter/resampler/trivial.c
modules/audio_filter/resampler/trivial.c
+6
-4
No files found.
modules/audio_filter/resampler/trivial.c
View file @
33913b06
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* trivial.c : trivial resampler (skips samples or pads with zeroes)
* trivial.c : trivial resampler (skips samples or pads with zeroes)
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* Copyright (C) 2002 VideoLAN
* $Id: trivial.c,v 1.
4 2002/08/21 22:41:59 massiot
Exp $
* $Id: trivial.c,v 1.
5 2002/08/24 16:07:48 sam
Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
...
@@ -80,22 +80,24 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
...
@@ -80,22 +80,24 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
int
i_in_nb
=
p_in_buf
->
i_nb_samples
;
int
i_in_nb
=
p_in_buf
->
i_nb_samples
;
int
i_out_nb
=
i_in_nb
*
p_filter
->
output
.
i_rate
int
i_out_nb
=
i_in_nb
*
p_filter
->
output
.
i_rate
/
p_filter
->
input
.
i_rate
;
/
p_filter
->
input
.
i_rate
;
int
i_frame_bytes
=
p_filter
->
input
.
i_channels
*
sizeof
(
s32
);
if
(
p_out_buf
!=
p_in_buf
)
if
(
p_out_buf
!=
p_in_buf
)
{
{
/* For whatever reason the buffer allocator decided to allocate
/* For whatever reason the buffer allocator decided to allocate
* a new buffer. Currently, this never happens. */
* a new buffer. Currently, this never happens. */
p_aout
->
p_vlc
->
pf_memcpy
(
p_out_buf
->
p_buffer
,
p_in_buf
->
p_buffer
,
p_aout
->
p_vlc
->
pf_memcpy
(
p_out_buf
->
p_buffer
,
p_in_buf
->
p_buffer
,
__MIN
(
i_out_nb
,
i_in_nb
)
);
__MIN
(
i_out_nb
,
i_in_nb
)
*
i_frame_bytes
);
}
}
if
(
i_out_nb
>
i_in_nb
)
if
(
i_out_nb
>
i_in_nb
)
{
{
/* Pad with zeroes. */
/* Pad with zeroes. */
memset
(
p_out_buf
->
p_buffer
+
i_in_nb
,
0
,
i_out_nb
-
i_in_nb
);
memset
(
p_out_buf
->
p_buffer
+
i_in_nb
*
i_frame_bytes
,
0
,
(
i_out_nb
-
i_in_nb
)
*
i_frame_bytes
);
}
}
p_out_buf
->
i_nb_samples
=
i_out_nb
;
p_out_buf
->
i_nb_samples
=
i_out_nb
;
p_out_buf
->
i_nb_bytes
=
i_out_nb
*
sizeof
(
s32
)
;
p_out_buf
->
i_nb_bytes
=
i_out_nb
*
i_frame_bytes
;
}
}
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