| Summary: | audio glitch after internal resampling | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sylvain <sylvain.becker> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | don't know | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | sound | ||
|
Description
Sylvain
2016-12-05 12:34:29 UTC
Ryan,
I think there may be an issue when downsampling (and also upsampling),
I would apply this patch (and the same for upsampling):
--- a/src/audio/SDL_audiotypecvt.c Tue Dec 13 00:22:42 2016 -0500
+++ b/src/audio/SDL_audiotypecvt.c Wed Dec 14 14:37:06 2016 +0100
@@ -283,11 +283,11 @@
SDL_memcpy(last_sample, src, cpy);
while (dst < target) {
- src += 8;
+ src += channels;
eps += dstsize;
if ((eps << 1) >= srcsize) {
SDL_memcpy(dst, sample, cpy);
- dst += 8;
+ dst += channels;
for (i = 0; i < channels; i++) {
sample[i] = (float) ((((double) src[i]) + ((double) last_sample[i])) * 0.5);
}
Whoops, sorry! This is fixed now in https://hg.libsdl.org/SDL/rev/f6cd81aab88e ! --ryan. |