diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llvoicevivox.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index a64c05a3c6..f1c8ce21d2 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -96,6 +96,9 @@ const int MAX_LOGIN_RETRIES = 12; // blocked is VERY rare and it's better to sacrifice response time in this situation for the sake of stability. const int MAX_NORMAL_JOINING_SPATIAL_NUM = 50; +// Maximum length of capture buffer recordings +const F32 CAPTURE_BUFFER_MAX_TIME = 15.f; + static int scale_mic_volume(float volume) { @@ -1154,12 +1157,15 @@ void LLVivoxVoiceClient::stateMachine() case stateCaptureBufferRecStart: captureBufferRecordStartSendMessage(); mCaptureBufferRecorded = true; + mCaptureTimer.start(); + mCaptureTimer.setTimerExpirySec(CAPTURE_BUFFER_MAX_TIME); setState(stateCaptureBufferRecording); break; //MARK: stateCaptureBufferRecording case stateCaptureBufferRecording: - if (!mCaptureBufferMode || !mCaptureBufferRecording || mCaptureBufferPlaying) + if (!mCaptureBufferMode || !mCaptureBufferRecording || + mCaptureBufferPlaying || mCaptureTimer.hasExpired()) { mCaptureBufferRecording = false; captureBufferRecordStopSendMessage(); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index e4250d2ba3..3c7567610d 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -924,6 +924,7 @@ private: bool mCaptureBufferRecorded; // A voice sample is captured in the buffer ready to play. bool mCaptureBufferPlaying; // A voice sample is being played. + LLTimer mCaptureTimer; LLUUID mPreviewVoiceFontID; }; |