From 1419b39a89159cc708cb40a89e494f22c0a50834 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 17 May 2007 11:43:53 +0000 Subject: [PATCH] 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 --- snd_coreaudio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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", -- 2.39.2