[Audio Output] Only unregister listener if used

Only unregister the listener if it actually has been registered, and
clear the handle upon doing so.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
xcode15
Christopher Snowhill 2022-07-15 22:51:59 -07:00
parent 804e7652a8
commit 3f212f0cfb
1 changed files with 4 additions and 1 deletions

View File

@ -1126,7 +1126,10 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
}
- (void)removeSynchronizerBlock {
[renderSynchronizer removeTimeObserver:currentPtsObserver];
if(renderSynchronizer && currentPtsObserver) {
[renderSynchronizer removeTimeObserver:currentPtsObserver];
currentPtsObserver = nil;
}
}
- (void)setVolume:(double)v {