Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resampling non-8-bit audio may result in garbage #1347

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Resampling non-8-bit audio may result in garbage #1347

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.1
Reported for operating system, platform: Windows (XP), x86

Comments on the original bug report:

On 2014-02-10 16:18:15 +0000, Dávid Nagy wrote:

Created attachment 1554
Testcase demonstrating the bug and a possible fix

When resampling, the calculation of the new size ignores the size of the samples (and the number of channels).
const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
This might result in a size that is not a multiple of the sample size.
And since upsampling is done from the end to the beginning, the new samples will start at the wrong place.

On 2014-02-23 01:48:29 +0000, Sam Lantinga wrote:

Ryan, can you look at this for the 2.0.2 release?

Thanks!

On 2014-06-04 16:47:22 +0000, Dávid Nagy wrote:

Created attachment 1669
My proposed fix.

Apply to SDL2-2.0.1/src/audio/sdlgenaudiocvt.pl

On 2014-06-10 23:40:10 +0000, Ryan C. Gordon wrote:

(In reply to nagydavid91+sdl-bugzilla from comment # 2)

Created attachment 1669 [details]
My proposed fix.

This patch is now https://hg.libsdl.org/SDL/rev/5da12bedaace ...thanks!

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant