mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-26 10:41:06 +01:00
Limit DirectSound maximum sample rate
This commit is contained in:
committed by
Ryan C. Gordon
parent
3debb9e2bb
commit
f9e82031f4
@@ -526,6 +526,7 @@ static int DSOUND_OpenDevice(_THIS, const char *devname)
|
||||
tried_format = SDL_TRUE;
|
||||
|
||||
this->spec.format = test_format;
|
||||
this->spec.freq = SDL_min(DSBFREQUENCY_MAX, this->spec.freq);
|
||||
|
||||
/* Update the fragment size as size in bytes */
|
||||
SDL_CalculateAudioSpec(&this->spec);
|
||||
@@ -580,7 +581,7 @@ static int DSOUND_OpenDevice(_THIS, const char *devname)
|
||||
}
|
||||
|
||||
wfmt.Format.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format);
|
||||
wfmt.Format.nChannels = this->spec.channels;
|
||||
wfmt.Format.nChannels = (WORD)this->spec.channels;
|
||||
wfmt.Format.nSamplesPerSec = this->spec.freq;
|
||||
wfmt.Format.nBlockAlign = wfmt.Format.nChannels * (wfmt.Format.wBitsPerSample / 8);
|
||||
wfmt.Format.nAvgBytesPerSec = wfmt.Format.nSamplesPerSec * wfmt.Format.nBlockAlign;
|
||||
|
||||
Reference in New Issue
Block a user