]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_coreaudio.c
cvar apple_mouse_noaccel (1 default) disables mouse acceleration
[xonotic/darkplaces.git] / snd_coreaudio.c
index 9d9381253fdc42aa52f5d69023722a391ec4876d..c10789f0173ef48058d7f6fb9a2946c4c47210cb 100644 (file)
@@ -141,23 +141,11 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
        if (suggested != NULL)
                memcpy (suggested, requested, sizeof (suggested));
 
-       // Get the device status and suggest any appropriate changes to format
-       propertySize = sizeof(streamDesc);
-       status = AudioDeviceGetProperty(outputDeviceID, 0, false, kAudioDevicePropertyStreamFormat, &propertySize, &streamDesc);
-       if (status)
-       {
-               Con_Printf("CoreAudio: AudioDeviceGetProperty() returned %d when getting kAudioDevicePropertyStreamFormat\n", status);
-               return false;
-       }
-       // Suggest proper settings if they differ
-       if (requested->channels != streamDesc.mChannelsPerFrame || requested->speed != streamDesc.mSampleRate || requested->width != streamDesc.mBitsPerChannel/8)
+       if(requested->width != 2)
        {
-               if (suggested != NULL)
-               {
-                       suggested->channels = streamDesc.mChannelsPerFrame;
-                       suggested->speed = streamDesc.mSampleRate;
-                       suggested->width = streamDesc.mBitsPerChannel/8;
-               }
+               // we can only do 16bit per sample for now
+               if(suggested != NULL)
+                       suggested->width = 2;
                return false;
        }
 
@@ -210,6 +198,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
                Con_Printf("CoreAudio: AudioDeviceGetProperty() returned %d when getting kAudioDevicePropertyStreamFormat\n", status);
                return false;
        }
+
        Con_DPrint ("   Hardware format:\n");
        Con_DPrintf("    %5d mSampleRate\n", (unsigned int)streamDesc.mSampleRate);
        Con_DPrintf("     %c%c%c%c mFormatID\n",
@@ -223,6 +212,17 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
        Con_DPrintf("    %5d mChannelsPerFrame\n", streamDesc.mChannelsPerFrame);
        Con_DPrintf("    %5d mBitsPerChannel\n", streamDesc.mBitsPerChannel);
 
+       // Suggest proper settings if they differ
+       if (requested->channels != streamDesc.mChannelsPerFrame || requested->speed != streamDesc.mSampleRate)
+       {
+               if (suggested != NULL)
+               {
+                       suggested->channels = streamDesc.mChannelsPerFrame;
+                       suggested->speed = streamDesc.mSampleRate;
+               }
+               return false;
+       }
+
        if(streamDesc.mFormatID != kAudioFormatLinearPCM)
        {
                Con_Print("CoreAudio: Default audio device doesn't support linear PCM!\n");