Core Audio output: Add a quick safety fix
Add a safety fix for pausing and shutting down, so that we don't call into AUAudioUnit's stopHardware function unless the stream has already been started by the output. Signed-off-by: Christopher Snowhill <kode54@gmail.com>CQTexperiment
parent
ee7b7dad5f
commit
bbce6880d7
|
@ -755,7 +755,8 @@ default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const
|
|||
listenerapplied = NO;
|
||||
}
|
||||
if (_au) {
|
||||
[_au stopHardware];
|
||||
if (started)
|
||||
[_au stopHardware];
|
||||
_au = nil;
|
||||
}
|
||||
if (running)
|
||||
|
@ -791,7 +792,8 @@ default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const
|
|||
- (void)pause
|
||||
{
|
||||
paused = YES;
|
||||
[_au stopHardware];
|
||||
if (started)
|
||||
[_au stopHardware];
|
||||
}
|
||||
|
||||
- (void)resume
|
||||
|
@ -799,6 +801,7 @@ default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const
|
|||
NSError *err;
|
||||
[_au startHardwareAndReturnError:&err];
|
||||
paused = NO;
|
||||
started = YES;
|
||||
}
|
||||
|
||||
- (void)sustainHDCD
|
||||
|
|
Loading…
Reference in New Issue