]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_alsa.c
set csqc world.mins and world.maxs (reworked World_SetSize to make this
[xonotic/darkplaces.git] / snd_alsa.c
index 433e8859cbe16d4561544cf82839e0f72e878bbd..7f15da37fbdaf52d39eb39c496d7cbd43f5e51aa 100644 (file)
 
 // ALSA module, used by Linux
 
+#include "quakedef.h"
 
 #include <alsa/asoundlib.h>
 
-#include "quakedef.h"
 #include "snd_main.h"
 
 
@@ -63,7 +63,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
 
                if (suggested != NULL)
                {
-                       memcpy (suggested, requested, sizeof (suggested));
+                       memcpy (suggested, requested, sizeof (*suggested));
 
                        if (requested->width < 1)
                                suggested->width = 1;
@@ -105,7 +105,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
                pcm_name = com_argv[i + 1];
 
        // Open the audio device
-       Con_DPrintf ("SndSys_Init: PCM device is \"%s\"\n", pcm_name);
+       Con_Printf ("SndSys_Init: PCM device is \"%s\"\n", pcm_name);
        err = snd_pcm_open (&pcm_handle, pcm_name, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
        if (err != 0)
        {
@@ -259,7 +259,7 @@ static qboolean SndSys_Recover (int err_num)
        err = snd_pcm_prepare (pcm_handle);
        if (err != 0)
        {
-               Con_DPrintf ("SndSys_Recover: unable to recover (%s)\n",
+               Con_Printf ("SndSys_Recover: unable to recover (%s)\n",
                                         snd_strerror (err));
 
                // TOCHECK: should we stop the playback ?
@@ -283,7 +283,7 @@ static snd_pcm_sframes_t SndSys_Write (const unsigned char* buffer, unsigned int
        written = snd_pcm_writei (pcm_handle, buffer, nbframes);
        if (written < 0)
        {
-               if (developer.integer >= 1000)
+               if (developer.integer >= 1000 && vid_activewindow)
                        Con_Printf ("SndSys_Write: audio write returned %ld (%s)!\n",
                                                 written, snd_strerror (written));
 
@@ -361,7 +361,7 @@ unsigned int SndSys_GetSoundTime (void)
        err = snd_pcm_delay (pcm_handle, &delay);
        if (err != 0)
        {
-               if (developer.integer >= 1000)
+               if (developer.integer >= 1000 && vid_activewindow)
                        Con_DPrintf ("SndSys_GetSoundTime: can't get playback delay (%s)\n",
                                                 snd_strerror (err));