Browse Source

Fix stats being reset when enabling the analysis twice

The stats were reset whenever "setAnalysisEnabledXXX(true)" was called.
Due to this, if the analysis for audio or video was already enabled and
the method was called again the stats were wrongly reset. The stats
should be reset only when the analysis is really started again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/5885/head
Daniel Calviño Sánchez 4 years ago
parent
commit
92051853a6
  1. 8
      src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js

8
src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js

@ -203,6 +203,10 @@ PeerConnectionAnalyzer.prototype = {
},
setAnalysisEnabledAudio(analysisEnabledAudio) {
if (this._analysisEnabled.audio === analysisEnabledAudio) {
return
}
this._analysisEnabled.audio = analysisEnabledAudio
if (!analysisEnabledAudio) {
@ -213,6 +217,10 @@ PeerConnectionAnalyzer.prototype = {
},
setAnalysisEnabledVideo(analysisEnabledVideo) {
if (this._analysisEnabled.video === analysisEnabledVideo) {
return
}
this._analysisEnabled.video = analysisEnabledVideo
if (!analysisEnabledVideo) {

Loading…
Cancel
Save