Skip to content

Commit

Permalink
* Removed the redundant "sound system is muted" message
Browse files Browse the repository at this point in the history
* Moved printing of desired audiospec to before SDL_OpenAudio
* When the computed value for samples is not a power of 2, now pick the smallest power of 2 greater rather than the largest power of 2 smaller
  • Loading branch information
timangus committed Sep 24, 2005
1 parent fe14a45 commit f0bd20e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions code/client/snd_dma.c
Expand Up @@ -109,10 +109,6 @@ void S_SoundInfo_f(void) {
if (!s_soundStarted) {
Com_Printf ("sound system not started\n");
} else {
if ( s_soundMuted ) {
Com_Printf ("sound system is muted\n");
}

Com_Printf("%5d stereo\n", dma.channels - 1);
Com_Printf("%5d samples\n", dma.samples);
Com_Printf("%5d samplebits\n", dma.samplebits);
Expand Down
4 changes: 2 additions & 2 deletions code/unix/sdl_snd.c
Expand Up @@ -213,14 +213,15 @@ qboolean SNDDMA_Init(void)
desired.channels = (int) sndchannels->value;
desired.callback = sdl_audio_callback;

print_audiospec("Format we requested from SDL audio device", &desired);

if (SDL_OpenAudio(&desired, &obtained) == -1)
{
Com_Printf("SDL_OpenAudio() failed: %s\n", SDL_GetError());
SDL_QuitSubSystem(SDL_INIT_AUDIO);
return qfalse;
} // if

print_audiospec("Format we requested from SDL audio device", &desired);
print_audiospec("Format we actually got", &obtained);

// dma.samples needs to be big, or id's mixer will just refuse to
Expand All @@ -240,7 +241,6 @@ qboolean SNDDMA_Init(void)
while (val < tmp)
val <<= 1;

val >>= 1;
Com_Printf("WARNING: sdlmixsamps wasn't a power of two (%d),"
" so we made it one (%d).\n", tmp, val);
tmp = val;
Expand Down

0 comments on commit f0bd20e

Please sign in to comment.