Remove lastMuted member in AvatarAudioStream

This commit is contained in:
Atlante45 2014-11-17 10:32:28 -08:00
parent 46eebe9d40
commit 4615afe034
3 changed files with 4 additions and 14 deletions

View file

@ -776,13 +776,9 @@ void AudioMixer::run() {
// if the stream should be muted, send mute packet
if (nodeData->getAvatarAudioStream()
&& shouldMute(nodeData->getAvatarAudioStream()->getQuietestFrameLoudness())) {
static const int TIME_BETWEEN_MUTES = 5; // in secs
if (usecTimestampNow() - nodeData->getAvatarAudioStream()->getLastMuted() >
TIME_BETWEEN_MUTES * USECS_PER_SECOND) {
QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeNoisyMute);
nodeList->writeDatagram(packet, node);
nodeData->getAvatarAudioStream()->setLastMutedNow();
}
QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeNoisyMute);
nodeList->writeDatagram(packet, node);
nodeData->getAvatarAudioStream()->setLastMutedNow();
}
if (node->getType() == NodeType::Agent && node->getActiveSocket()

View file

@ -14,8 +14,7 @@
#include "AvatarAudioStream.h"
AvatarAudioStream::AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings) :
PositionalAudioStream(PositionalAudioStream::Microphone, isStereo, settings),
_lastMuted(usecTimestampNow())
PositionalAudioStream(PositionalAudioStream::Microphone, isStereo, settings)
{
}

View file

@ -20,17 +20,12 @@ class AvatarAudioStream : public PositionalAudioStream {
public:
AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings);
qint64 getLastMuted() const { return _lastMuted; }
void setLastMutedNow() { _lastMuted = usecTimestampNow(); }
private:
// disallow copying of AvatarAudioStream objects
AvatarAudioStream(const AvatarAudioStream&);
AvatarAudioStream& operator= (const AvatarAudioStream&);
int parseStreamProperties(PacketType type, const QByteArray& packetAfterSeqNum, int& numAudioSamples);
qint64 _lastMuted;
};
#endif // hifi_AvatarAudioStream_h