mirror of https://github.com/libsdl-org/SDL
Fixed some incorrect SDL_AUDIO_F32 uses
This commit is contained in:
parent
2833f2e7b5
commit
47bcb078f5
|
@ -765,7 +765,7 @@ SDL_bool SDL_OutputAudioThreadIterate(SDL_AudioDevice *device)
|
||||||
|
|
||||||
case MIXSTRATEGY_MIX: {
|
case MIXSTRATEGY_MIX: {
|
||||||
//SDL_Log("MIX STRATEGY: MIX");
|
//SDL_Log("MIX STRATEGY: MIX");
|
||||||
float *mix_buffer = (float *) ((device->spec.format == SDL_AUDIO_F32) ? device_buffer : device->mix_buffer);
|
float *mix_buffer = (float *) ((device->spec.format == SDL_AUDIO_F32SYS) ? device_buffer : device->mix_buffer);
|
||||||
const int needed_samples = buffer_size / (SDL_AUDIO_BITSIZE(device->spec.format) / 8);
|
const int needed_samples = buffer_size / (SDL_AUDIO_BITSIZE(device->spec.format) / 8);
|
||||||
const int work_buffer_size = needed_samples * sizeof (float);
|
const int work_buffer_size = needed_samples * sizeof (float);
|
||||||
SDL_AudioSpec outspec;
|
SDL_AudioSpec outspec;
|
||||||
|
|
|
@ -842,14 +842,14 @@ static int audio_resampleLoss(void *arg)
|
||||||
SDLTest_AssertPass("Test resampling of %i s %i Hz %f phase sine wave from sampling rate of %i Hz to %i Hz",
|
SDLTest_AssertPass("Test resampling of %i s %i Hz %f phase sine wave from sampling rate of %i Hz to %i Hz",
|
||||||
spec->time, spec->freq, spec->phase, spec->rate_in, spec->rate_out);
|
spec->time, spec->freq, spec->phase, spec->rate_in, spec->rate_out);
|
||||||
|
|
||||||
tmpspec1.format = SDL_AUDIO_F32;
|
tmpspec1.format = SDL_AUDIO_F32SYS;
|
||||||
tmpspec1.channels = num_channels;
|
tmpspec1.channels = num_channels;
|
||||||
tmpspec1.freq = spec->rate_in;
|
tmpspec1.freq = spec->rate_in;
|
||||||
tmpspec2.format = SDL_AUDIO_F32;
|
tmpspec2.format = SDL_AUDIO_F32SYS;
|
||||||
tmpspec2.channels = num_channels;
|
tmpspec2.channels = num_channels;
|
||||||
tmpspec2.freq = spec->rate_out;
|
tmpspec2.freq = spec->rate_out;
|
||||||
stream = SDL_CreateAudioStream(&tmpspec1, &tmpspec2);
|
stream = SDL_CreateAudioStream(&tmpspec1, &tmpspec2);
|
||||||
SDLTest_AssertPass("Call to SDL_CreateAudioStream(SDL_AUDIO_F32, 1, %i, SDL_AUDIO_F32, 1, %i)", spec->rate_in, spec->rate_out);
|
SDLTest_AssertPass("Call to SDL_CreateAudioStream(SDL_AUDIO_F32SYS, 1, %i, SDL_AUDIO_F32SYS, 1, %i)", spec->rate_in, spec->rate_out);
|
||||||
SDLTest_AssertCheck(stream != NULL, "Expected SDL_CreateAudioStream to succeed.");
|
SDLTest_AssertCheck(stream != NULL, "Expected SDL_CreateAudioStream to succeed.");
|
||||||
if (stream == NULL) {
|
if (stream == NULL) {
|
||||||
return TEST_ABORTED;
|
return TEST_ABORTED;
|
||||||
|
@ -1020,13 +1020,13 @@ static int audio_convertAccuracy(void *arg)
|
||||||
float target_max_delta = (bits > 23) ? 0.0f : (1.0f / (float)(1 << bits));
|
float target_max_delta = (bits > 23) ? 0.0f : (1.0f / (float)(1 << bits));
|
||||||
float target_min_delta = -target_max_delta;
|
float target_min_delta = -target_max_delta;
|
||||||
|
|
||||||
src_spec.format = SDL_AUDIO_F32;
|
src_spec.format = SDL_AUDIO_F32SYS;
|
||||||
src_spec.channels = 1;
|
src_spec.channels = 1;
|
||||||
src_spec.freq = 44800;
|
src_spec.freq = 44100;
|
||||||
|
|
||||||
tmp_spec.format = format;
|
tmp_spec.format = format;
|
||||||
tmp_spec.channels = 1;
|
tmp_spec.channels = 1;
|
||||||
tmp_spec.freq = 44800;
|
tmp_spec.freq = 44100;
|
||||||
|
|
||||||
convert_begin = SDL_GetPerformanceCounter();
|
convert_begin = SDL_GetPerformanceCounter();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue