Handle JackChanged getting called when the device is stopped.
This commit is contained in:
@@ -486,8 +486,15 @@ OSStatus RageSound_CA::JackChanged( AudioDeviceID inDevice, UInt32 inChannel, Bo
|
|||||||
result ? "something" : "nothing") );
|
result ? "something" : "nothing") );
|
||||||
|
|
||||||
if( (error = AudioDeviceGetCurrentTime(inDevice, &time)) )
|
if( (error = AudioDeviceGetCurrentTime(inDevice, &time)) )
|
||||||
|
{
|
||||||
|
if( error != kAudioHardwareNotRunningError )
|
||||||
FAIL_M( ERROR("Couldn't get current time when jack changed", error) );
|
FAIL_M( ERROR("Couldn't get current time when jack changed", error) );
|
||||||
|
This->m_iOffset = This->m_iLastSampleTime;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
This->m_iOffset = This->m_iLastSampleTime - int64_t( time.mSampleTime );
|
This->m_iOffset = This->m_iLastSampleTime - int64_t( time.mSampleTime );
|
||||||
|
}
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user