Fixed bug causing all sounds to be streamed in 64-bit Mac OS X builds.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4020 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2011-01-06 18:14:47 +00:00
parent 7f39d6d436
commit 0420f964ab
2 changed files with 5 additions and 6 deletions

View File

@ -38,6 +38,8 @@ SOFTWARE.
#import <CoreAudio/CoreAudio.h>
#import <AudioToolbox/AudioToolbox.h>
#import "NSThreadOOExtensions.h"
#import "OOCollectionExtractors.h"
#define KEY_VOLUME_CONTROL @"volume_control"
#define KEY_MAX_BUFFERED_SOUND @"max_buffered_sound"
@ -150,11 +152,8 @@ static struct
else sNominalVolume = 0.75; // default setting at 75% system volume
[[OOSoundMixer sharedMixer] setMasterVolume:sNominalVolume];
if ([prefs objectForKey:KEY_MAX_BUFFERED_SOUND])
{
int maxSize = [prefs integerForKey:KEY_MAX_BUFFERED_SOUND];
if (0 <= maxSize) sMaxBufferedSoundSize = maxSize;
}
int maxSize = [prefs oo_intForKey:KEY_MAX_BUFFERED_SOUND defaultValue:sMaxBufferedSoundSize];
if (0 <= maxSize) sMaxBufferedSoundSize = maxSize;
}
}

View File

@ -430,7 +430,7 @@ static void MixDown(float *inChan1, float *inChan2, float *outMix, size_t inCoun
size = ov_pcm_total(&_vf, -1);
size *= sizeof(float) * ([self isStereo] ? 2 : 1);
if ((ogg_int64_t)SIZE_T_MAX < size) size = (ogg_int64_t)SIZE_T_MAX;
if ((uint64_t)SIZE_T_MAX < (uint64_t)size) size = (ogg_int64_t)SIZE_T_MAX;
return size;
}