Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
124f79a2
Commit
124f79a2
authored
Oct 23, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_resample: don't resample partial samples
Added assertions which ensure that there are no partial samples in the source buffer.
parent
b13d656f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
pcm_resample_fallback.c
src/pcm_resample_fallback.c
+5
-0
pcm_resample_libsamplerate.c
src/pcm_resample_libsamplerate.c
+4
-0
No files found.
src/pcm_resample_fallback.c
View file @
124f79a2
...
...
@@ -20,6 +20,8 @@
#include "pcm_resample.h"
#include "gcc.h"
#include <assert.h>
/* resampling code blatantly ripped from ESD */
size_t
pcm_resample_16
(
uint8_t
channels
,
...
...
@@ -33,6 +35,9 @@ pcm_resample_16(uint8_t channels,
unsigned
dest_samples
=
dest_size
/
sizeof
(
*
dest_buffer
);
int16_t
lsample
,
rsample
;
assert
((
src_size
%
(
sizeof
(
*
src_buffer
)
*
channels
))
==
0
);
assert
((
dest_size
%
(
sizeof
(
*
dest_buffer
)
*
channels
))
==
0
);
switch
(
channels
)
{
case
1
:
while
(
dest_pos
<
dest_samples
)
{
...
...
src/pcm_resample_libsamplerate.c
View file @
124f79a2
...
...
@@ -22,6 +22,7 @@
#include "log.h"
#include "utils.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -75,6 +76,9 @@ pcm_resample_16(uint8_t channels,
size_t
data_out_size
;
int
error
;
assert
((
src_size
%
(
sizeof
(
*
src_buffer
)
*
channels
))
==
0
);
assert
((
dest_size
%
(
sizeof
(
*
dest_buffer
)
*
channels
))
==
0
);
if
(
convalgo
<
0
)
convalgo
=
pcm_resample_get_converter
();
...
...
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