From: havoc Date: Thu, 17 May 2007 11:43:53 +0000 (+0000) Subject: fix CoreAudio support so that it suggests a proper sound speed when the X-Git-Tag: xonotic-v0.1.0preview~3157 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1419b39a89159cc708cb40a89e494f22c0a50834;p=xonotic%2Fdarkplaces.git fix CoreAudio support so that it suggests a proper sound speed when the hardware returns a different value git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7296 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_coreaudio.c b/snd_coreaudio.c index fa68470d..cdcf6139 100644 --- a/snd_coreaudio.c +++ b/snd_coreaudio.c @@ -200,6 +200,18 @@ 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; } + + // Suggest the proper speed if it differs + if (requested.speed != streamDesc.mSampleRate) + { + if (suggested != NULL) + { + memcpy (suggested, requested, sizeof (suggested)); + suggested->speed = streamDesc.mSampleRate; + } + return false; + } + Con_DPrint (" Hardware format:\n"); Con_DPrintf(" %5d mSampleRate\n", (unsigned int)streamDesc.mSampleRate); Con_DPrintf(" %c%c%c%c mFormatID\n",