[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>
main
Christopher Snowhill 2022-07-15 22:52:46 -07:00
parent 76d612faf4
commit 72ed975d56
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]; [self removeSynchronizerBlock];
[renderSynchronizer setRate:0]; [renderSynchronizer setRate:0];
if(audioRenderer) {
[renderSynchronizer removeRenderer:audioRenderer atTime:kCMTimeZero completionHandler:^(BOOL didRemoveRenderer) {
if(!didRemoveRenderer) {
DLog(@"Error removing renderer!");
}
}];
}
} }
if(audioRenderer) { if(audioRenderer) {
[audioRenderer stopRequestingMediaData]; [audioRenderer stopRequestingMediaData];