git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6951
d7cf8633-e32d-0410-b094-
e92efae38249
if (prog->knownstrings[i] == s)
return -1 - i;
// new unknown engine string
if (prog->knownstrings[i] == s)
return -1 - i;
// new unknown engine string
- if (developer.integer >= 100)
+ if (developer.integer >= 200)
Con_Printf("new engine string %p\n", s);
for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++)
if (!prog->knownstrings[i])
Con_Printf("new engine string %p\n", s);
for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++)
if (!prog->knownstrings[i])
outBuffer = (float*)outOutputData->mBuffers[0].mData;
factor = snd_renderbuffer->format.channels * snd_renderbuffer->format.width;
frameCount = 0;
outBuffer = (float*)outOutputData->mBuffers[0].mData;
factor = snd_renderbuffer->format.channels * snd_renderbuffer->format.width;
frameCount = 0;
// Lock the snd_renderbuffer
if (SndSys_LockRenderBuffer())
{
// Lock the snd_renderbuffer
if (SndSys_LockRenderBuffer())
{
samples = (const short*)(&snd_renderbuffer->ring[startOffset * factor]);
for (sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++)
outBuffer[sampleIndex] = samples[sampleIndex] * scale;
samples = (const short*)(&snd_renderbuffer->ring[startOffset * factor]);
for (sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++)
outBuffer[sampleIndex] = samples[sampleIndex] * scale;
outBuffer = &outBuffer[sampleCount];
sampleCount = frameCount * snd_renderbuffer->format.channels - sampleCount;
samples = (const short*)(&snd_renderbuffer->ring[0]);
outBuffer = &outBuffer[sampleCount];
sampleCount = frameCount * snd_renderbuffer->format.channels - sampleCount;
samples = (const short*)(&snd_renderbuffer->ring[0]);
if (frameCount < submissionChunk)
{
unsigned int missingFrames;
if (frameCount < submissionChunk)
{
unsigned int missingFrames;
missingFrames = submissionChunk - frameCount;
missingFrames = submissionChunk - frameCount;
- Con_DPrintf("audioDeviceIOProc: %u sample frames missing\n", missingFrames);
+ if (developer.integer >= 200)
+ Con_Printf("audioDeviceIOProc: %u sample frames missing\n", missingFrames);
memset(&outBuffer[frameCount * snd_renderbuffer->format.channels], 0, missingFrames * sizeof(outBuffer[0]));
}
memset(&outBuffer[frameCount * snd_renderbuffer->format.channels], 0, missingFrames * sizeof(outBuffer[0]));
}
return true;
Con_Printf("Initializing CoreAudio...\n");
return true;
Con_Printf("Initializing CoreAudio...\n");
// We only accept 16-bit samples for the moment
if (requested->width != 2)
{
// We only accept 16-bit samples for the moment
if (requested->width != 2)
{
// Get the output device
propertySize = sizeof(outputDeviceID);
status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propertySize, &outputDeviceID);
// Get the output device
propertySize = sizeof(outputDeviceID);
status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propertySize, &outputDeviceID);
return;
}
s_isRunning = false;
return;
}
s_isRunning = false;
pthread_mutex_destroy(&coreaudio_mutex);
status = AudioDeviceRemoveIOProc(outputDeviceID, audioDeviceIOProc);
pthread_mutex_destroy(&coreaudio_mutex);
status = AudioDeviceRemoveIOProc(outputDeviceID, audioDeviceIOProc);
Sys_Error("SDL sound: invalid buffer length passed to Buffer_Callback (%d bytes)\n", len);
RequestedFrames = (unsigned int)len / factor;
Sys_Error("SDL sound: invalid buffer length passed to Buffer_Callback (%d bytes)\n", len);
RequestedFrames = (unsigned int)len / factor;
// Transfert up to a chunk of samples from snd_renderbuffer to stream
MaxFrames = snd_renderbuffer->endframe - snd_renderbuffer->startframe;
if (MaxFrames > RequestedFrames)
// Transfert up to a chunk of samples from snd_renderbuffer to stream
MaxFrames = snd_renderbuffer->endframe - snd_renderbuffer->startframe;
if (MaxFrames > RequestedFrames)
PartialLength1 = (snd_renderbuffer->maxframes - StartOffset) * factor;
memcpy(stream, &snd_renderbuffer->ring[StartOffset * factor], PartialLength1);
PartialLength1 = (snd_renderbuffer->maxframes - StartOffset) * factor;
memcpy(stream, &snd_renderbuffer->ring[StartOffset * factor], PartialLength1);
PartialLength2 = FrameCount * factor - PartialLength1;
memcpy(&stream[PartialLength1], &snd_renderbuffer->ring[0], PartialLength2);
}
PartialLength2 = FrameCount * factor - PartialLength1;
memcpy(&stream[PartialLength1], &snd_renderbuffer->ring[0], PartialLength2);
}
snd_renderbuffer->startframe += FrameCount;
snd_renderbuffer->startframe += FrameCount;
- if (FrameCount < RequestedFrames && developer.integer >= 100)
+ if (FrameCount < RequestedFrames && developer.integer >= 200)
Con_DPrintf("SDL sound: %u sample frames missing\n", RequestedFrames - FrameCount);
sdlaudiotime += RequestedFrames;
Con_DPrintf("SDL sound: %u sample frames missing\n", RequestedFrames - FrameCount);
sdlaudiotime += RequestedFrames;
wantspec.channels, wantspec.format, wantspec.freq, wantspec.samples);
if( SDL_OpenAudio( &wantspec, &obtainspec ) )
wantspec.channels, wantspec.format, wantspec.freq, wantspec.samples);
if( SDL_OpenAudio( &wantspec, &obtainspec ) )
Con_Printf( "Failed to open the audio device! (%s)\n", SDL_GetError() );
return false;
}
Con_Printf( "Failed to open the audio device! (%s)\n", SDL_GetError() );
return false;
}
if (snd_channellayout.integer == SND_CHANNELLAYOUT_AUTO)
{
int newlayout;
if (snd_channellayout.integer == SND_CHANNELLAYOUT_AUTO)
{
int newlayout;
#ifdef __linux__
newlayout = SND_CHANNELLAYOUT_ALSA;
#else
#ifdef __linux__
newlayout = SND_CHANNELLAYOUT_ALSA;
#else
sdlaudiotime = 0;
SDL_PauseAudio( false );
sdlaudiotime = 0;
SDL_PauseAudio( false );