[Audio Output] Remove renderer from synchronizer

Remove the renderer from the synchronizer on stop, before releasing the
objects, if possible.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
xcode15
Christopher Snowhill 2022-07-15 22:52:46 -07:00
parent 3f212f0cfb
commit b5f6e0ec20
1 changed files with 7 additions and 0 deletions

View File

@ -1219,6 +1219,13 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
}
[self removeSynchronizerBlock];
[renderSynchronizer setRate:0];
if(audioRenderer) {
[renderSynchronizer removeRenderer:audioRenderer atTime:kCMTimeZero completionHandler:^(BOOL didRemoveRenderer) {
if(!didRemoveRenderer) {
DLog(@"Error removing renderer!");
}
}];
}
}
if(audioRenderer) {
[audioRenderer stopRequestingMediaData];