From 88e57bdfb871b427027b3f6b82e1c3808447960b Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 11 Mar 2007 23:53:31 +0000 Subject: [PATCH] increased minimum developer cvar level for several spammy messages (new engine string, sample frames missing) from 100 to 200, to make 100 more usable git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6951 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_edict.c | 2 +- snd_coreaudio.c | 15 ++++++++------- snd_sdl.c | 12 ++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/prvm_edict.c b/prvm_edict.c index f9db9de2..81dd5818 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -2089,7 +2089,7 @@ int PRVM_SetEngineString(const char *s) 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]) diff --git a/snd_coreaudio.c b/snd_coreaudio.c index 669b82f1..ca8da917 100644 --- a/snd_coreaudio.c +++ b/snd_coreaudio.c @@ -57,7 +57,7 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice, outBuffer = (float*)outOutputData->mBuffers[0].mData; factor = snd_renderbuffer->format.channels * snd_renderbuffer->format.width; frameCount = 0; - + // Lock the snd_renderbuffer if (SndSys_LockRenderBuffer()) { @@ -82,7 +82,7 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice, 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]); @@ -107,9 +107,10 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice, if (frameCount < submissionChunk) { unsigned int missingFrames; - + 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])); } @@ -136,7 +137,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) return true; Con_Printf("Initializing CoreAudio...\n"); - + // We only accept 16-bit samples for the moment if (requested->width != 2) { @@ -149,7 +150,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) return false; } - + // Get the output device propertySize = sizeof(outputDeviceID); status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propertySize, &outputDeviceID); @@ -275,7 +276,7 @@ void SndSys_Shutdown(void) return; } s_isRunning = false; - + pthread_mutex_destroy(&coreaudio_mutex); status = AudioDeviceRemoveIOProc(outputDeviceID, audioDeviceIOProc); diff --git a/snd_sdl.c b/snd_sdl.c index b82a56a4..01f1bdcd 100644 --- a/snd_sdl.c +++ b/snd_sdl.c @@ -38,7 +38,7 @@ static void Buffer_Callback (void *userdata, Uint8 *stream, int len) 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) @@ -53,7 +53,7 @@ static void Buffer_Callback (void *userdata, Uint8 *stream, int len) 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); } @@ -62,7 +62,7 @@ static void Buffer_Callback (void *userdata, Uint8 *stream, int len) 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; @@ -109,7 +109,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) 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; } @@ -144,7 +144,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) if (snd_channellayout.integer == SND_CHANNELLAYOUT_AUTO) { int newlayout; - + #ifdef __linux__ newlayout = SND_CHANNELLAYOUT_ALSA; #else @@ -155,7 +155,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) sdlaudiotime = 0; SDL_PauseAudio( false ); - + return true; } -- 2.39.2