Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 <[email protected]>
  • Loading branch information
danxuliu authored and backportbot[bot] committed Jul 1, 2021
commit a6fbeb6431c2c0da8b66c3931317727a29911e0a
8 changes: 8 additions & 0 deletions src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ PeerConnectionAnalyzer.prototype = {
},

setAnalysisEnabledAudio(analysisEnabledAudio) {
if (this._analysisEnabled.audio === analysisEnabledAudio) {
return
}

this._analysisEnabled.audio = analysisEnabledAudio

if (!analysisEnabledAudio) {
Expand All @@ -213,6 +217,10 @@ PeerConnectionAnalyzer.prototype = {
},

setAnalysisEnabledVideo(analysisEnabledVideo) {
if (this._analysisEnabled.video === analysisEnabledVideo) {
return
}

this._analysisEnabled.video = analysisEnabledVideo

if (!analysisEnabledVideo) {
Expand Down