RequestedFrames = (unsigned int)len / factor;
+ if (snd_usethreadedmixing)
+ {
+ S_MixToBuffer(stream, RequestedFrames);
+ if (snd_blocked)
+ memset(stream, snd_renderbuffer->format.width == 1 ? 0x80 : 0, len);
+ return;
+ }
+
// Transfert up to a chunk of samples from snd_renderbuffer to stream
MaxFrames = snd_renderbuffer->endframe - snd_renderbuffer->startframe;
if (MaxFrames > RequestedFrames)
SDL_AudioSpec wantspec;
SDL_AudioSpec obtainspec;
- Con_DSPrint ("SndSys_Init: using the SDL module\n");
+ snd_threaded = false;
+
+ Con_DPrint ("SndSys_Init: using the SDL module\n");
// Init the SDL Audio subsystem
if( SDL_InitSubSystem( SDL_INIT_AUDIO ) ) {
return false;
}
- buffersize = (unsigned int)ceil((double)requested->speed / 20.0);
+ buffersize = (unsigned int)ceil((double)requested->speed / 25.0); // 2048 bytes on 24kHz to 48kHz
// Init the SDL Audio subsystem
wantspec.callback = Buffer_Callback;
return false;
}
+ snd_threaded = true;
+
snd_renderbuffer = Snd_CreateRingBuffer(requested, 0, NULL);
if (snd_channellayout.integer == SND_CHANNELLAYOUT_AUTO)
{