mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-23 20:29:42 +00:00
Eliminated waiting here — either the buffer can be enqueued now or it is dropped.
This commit is contained in:
parent
48a00d9e05
commit
6079d30e58
@ -174,9 +174,8 @@ static void audioOutputCallback(
|
||||
|
||||
- (void)enqueueAudioBuffer:(const int16_t *)buffer numberOfSamples:(size_t)lengthInSamples
|
||||
{
|
||||
while(1)
|
||||
if([_writeLock tryLockWhenCondition:AudioQueueCanProceed])
|
||||
{
|
||||
[_writeLock lockWhenCondition:AudioQueueCanProceed];
|
||||
if((_audioStreamReadPosition + _streamLength) - _audioStreamWritePosition >= lengthInSamples)
|
||||
{
|
||||
size_t samplesBeforeOverflow = _streamLength - (_audioStreamWritePosition % _streamLength);
|
||||
@ -193,7 +192,6 @@ static void audioOutputCallback(
|
||||
|
||||
_audioStreamWritePosition += lengthInSamples;
|
||||
[_writeLock unlockWithCondition:[self writeLockCondition]];
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ class Vic20Document: MachineDocument {
|
||||
standardUserDefaults.registerDefaults([
|
||||
self.autoloadingUserDefaultsKey: true,
|
||||
self.memorySizeUserDefaultsKey: 5,
|
||||
self.countryUserDefaultsKey: 4
|
||||
self.countryUserDefaultsKey: 1
|
||||
])
|
||||
|
||||
let loadAutomatically = standardUserDefaults.boolForKey(self.autoloadingUserDefaultsKey)
|
||||
|
Loading…
Reference in New Issue
Block a user