]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_sdl.c
fixed a (hopefully rare) bug affecting shalrath missiles which caused multiple missil...
[xonotic/darkplaces.git] / snd_sdl.c
index 6dccba7371fae2146d18286b2e7f1a909a168fb2..b82a56a4737808ff9ffdcf439a933d94711fdac7 100644 (file)
--- a/snd_sdl.c
+++ b/snd_sdl.c
@@ -62,7 +62,7 @@ static void Buffer_Callback (void *userdata, Uint8 *stream, int len)
 
        snd_renderbuffer->startframe += FrameCount;
 
-       if (FrameCount < RequestedFrames)
+       if (FrameCount < RequestedFrames && developer.integer >= 100)
                Con_DPrintf("SDL sound: %u sample frames missing\n", RequestedFrames - FrameCount);
 
        sdlaudiotime += RequestedFrames;
@@ -141,6 +141,17 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
        }
 
        snd_renderbuffer = Snd_CreateRingBuffer(requested, 0, NULL);
+       if (snd_channellayout.integer == SND_CHANNELLAYOUT_AUTO)
+       {
+               int newlayout;
+               
+#ifdef __linux__
+               newlayout = SND_CHANNELLAYOUT_ALSA;
+#else
+               newlayout = SND_CHANNELLAYOUT_STANDARD;
+#endif
+               Cvar_SetValueQuick (&snd_channellayout, newlayout);
+       }
 
        sdlaudiotime = 0;
        SDL_PauseAudio( false );