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

SDL_ConvertMono doubles volume #197

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

SDL_ConvertMono doubles volume #197

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.9
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-08-03 01:31:59 +0000, Ryan C. Gordon wrote:

I might be on crack here.

It looks like SDL_ConvertMono() in src/audio/SDL_audiocvt.c adds the left and right channels of a stereo stream together, and clamps the new mono channel if it would overflow.

Shouldn't it be dividing by 2 to average the two sample points instead of clamping? Otherwise the mono sample point's volume doubles in the conversion. This would also make the conversion faster, as it replaces two branches per sample frame with a bitwise shift.

--ryan.

On 2006-09-24 11:56:40 +0000, Sam Lantinga wrote:

You're not on crack. :)
I fixed it in subversion, but I haven't tested it. Can you try it out and make sure it works now?

Thanks!

On 2006-09-24 12:10:39 +0000, Ryan C. Gordon wrote:

Reopened bug and assigning to me for testing.

--ryan.

On 2006-10-28 23:46:02 +0000, Ryan C. Gordon wrote:

Looks good to me.

--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