mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
use the existing not mixed count for injector inactivity
This commit is contained in:
parent
edfb65acf6
commit
f0ca412b29
1 changed files with 7 additions and 7 deletions
|
@ -157,12 +157,16 @@ void AudioMixerClientData::checkBuffersBeforeFrameSend() {
|
|||
while (it != _audioStreams.end()) {
|
||||
SharedStreamPointer stream = it->second;
|
||||
|
||||
static const int INJECTOR_INACTIVITY_USECS = 5 * USECS_PER_SECOND;
|
||||
if (stream->popFrames(1, true) > 0) {
|
||||
stream->updateLastPopOutputLoudnessAndTrailingLoudness();
|
||||
}
|
||||
|
||||
static const int INJECTOR_MAX_INACTIVE_BLOCKS = 500;
|
||||
|
||||
// if we don't have new data for an injected stream in the last INJECTOR_INACTIVITY_MSECS then
|
||||
// we remove the injector from our streams
|
||||
if (stream->getType() == PositionalAudioStream::Injector
|
||||
&& stream->usecsSinceLastPacket() > INJECTOR_INACTIVITY_USECS) {
|
||||
&& stream->getConsecutiveNotMixedCount() > INJECTOR_MAX_INACTIVE_BLOCKS) {
|
||||
// this is an inactive injector, pull it from our streams
|
||||
|
||||
// first emit that it is finished so that the HRTF objects for this source can be cleaned up
|
||||
|
@ -170,12 +174,8 @@ void AudioMixerClientData::checkBuffersBeforeFrameSend() {
|
|||
|
||||
// erase the stream to drop our ref to the shared pointer and remove it
|
||||
it = _audioStreams.erase(it);
|
||||
|
||||
|
||||
} else {
|
||||
if (stream->popFrames(1, true) > 0) {
|
||||
stream->updateLastPopOutputLoudnessAndTrailingLoudness();
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue