Core Audio output: Attempt to fix deadlock near track transitions when buffer resets occur

CQTexperiment
Christopher Snowhill 2022-01-19 14:38:48 -08:00
parent 5f82fa572e
commit 16a58e87a0
1 changed files with 3 additions and 0 deletions

View File

@ -221,6 +221,9 @@ default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const
}
if ([outputController shouldReset]) {
size_t length = [[outputController buffer] bufferedLength];
atomic_fetch_add(&bytesRendered, length);
[outputController incrementAmountPlayed:length];
[[outputController buffer] empty];
[outputController setShouldReset:NO];
}