Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Generate mixer buffer size from sample rate #483

Merged
merged 4 commits into from
Mar 10, 2022

Conversation

facespkz
Copy link
Contributor

@facespkz facespkz commented Mar 8, 2022

Fixes #429, but breaks slice_samplecount behavior. Suggested re-usage on line 234.

@facespkz facespkz changed the title Generate mixer buffer size from TICRATE Generate mixer buffer size from sample rate Mar 9, 2022
prboom2/src/SDL/i_sound.c Outdated Show resolved Hide resolved
prboom2/src/SDL/i_sound.c Show resolved Hide resolved
prboom2/src/SDL/i_sound.c Outdated Show resolved Hide resolved
{
int limit, n;

if (snd_samplecount) return snd_samplecount;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do the following:

if (snd_samplecount >= 32)
  return snd_samplecount * snd_samplerate / 11025;

so users can keep their config if they fine-tuned it with the previous implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Since those users have likely moved away from 512, I'll put this condition too:

if ((snd_samplecount >= 32) && (snd_samplecount != 512)) 
  return snd_samplecount * snd_samplerate / 11025;

Copy link
Collaborator

@fabiangreffrath fabiangreffrath Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, please don't. We don't need two "do nothing else" cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit that it's a hack, but shouldn't we handle the previous default? Or would it be safer to just do this for newer installs?

prboom2/src/m_misc.c Outdated Show resolved Hide resolved
@facespkz facespkz marked this pull request as ready for review March 9, 2022 20:21
@fabiangreffrath fabiangreffrath merged commit 5a5233a into coelckers:master Mar 10, 2022
@fabiangreffrath
Copy link
Collaborator

Thank you!

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

Successfully merging this pull request may close these issues.

(BUG) Chaingun sound slightly out of sync
2 participants