From: divverent Date: Fri, 18 May 2007 21:05:19 +0000 (+0000) Subject: only memcpy the suggested format if the failure is not permanent! Otherwise, it can... X-Git-Tag: xonotic-v0.1.0preview~3142 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c9e4c0cbf8d34beec09a97dfb764bf4b7921575b;p=xonotic%2Fdarkplaces.git only memcpy the suggested format if the failure is not permanent! Otherwise, it can lead to endless loops git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7313 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_coreaudio.c b/snd_coreaudio.c index c10789f0..cc533991 100644 --- a/snd_coreaudio.c +++ b/snd_coreaudio.c @@ -138,14 +138,14 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) Con_Printf("Initializing CoreAudio...\n"); - if (suggested != NULL) - memcpy (suggested, requested, sizeof (suggested)); - if(requested->width != 2) { // we can only do 16bit per sample for now if(suggested != NULL) + { + memcpy (suggested, requested, sizeof (suggested)); suggested->width = 2; + } return false; } @@ -217,6 +217,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) { if (suggested != NULL) { + memcpy (suggested, requested, sizeof (suggested)); suggested->channels = streamDesc.mChannelsPerFrame; suggested->speed = streamDesc.mSampleRate; }