Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-08-11 02:46:48 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2021-08-12 02:38:39 +0300
commit88356923cc166bc865c2533c771298d82da349bb (patch)
tree25b034cf9cd65420427a93f6ee646a6e2265ae89 /src
parent94c22ee79695fde8db5dfe31e08cb6b39a16da43 (diff)
Fix infinite loop when the frame rate can not be decreased
The previous minimum frame rate was wrongly got from the maximum frame rate, so when the minimum frame rate was compared after decreasing it it was always seen as changed. Due to this the constraints will be applied again even if they did not actually change due to having reached the minimum capped value, which would end in an infinite loop if the constraints could not be applied and the minimum frame rate was (tried to be) decreased again. However, note that the scenario above was unlikely to happen in the real world, as the browsers would likely accept the minimum capped value for the frame rate of 1. The problem would occur if the stream did not come from a device (even virtual ones) but from an HTML canvas or something similar that does not allow to change the constraints. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/utils/webrtc/VideoConstrainer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/webrtc/VideoConstrainer.js b/src/utils/webrtc/VideoConstrainer.js
index 893ab1221..b230350e6 100644
--- a/src/utils/webrtc/VideoConstrainer.js
+++ b/src/utils/webrtc/VideoConstrainer.js
@@ -297,7 +297,7 @@ VideoConstrainer.prototype = {
let changed = false
if (constraints.frameRate && constraints.frameRate.min) {
- const previousFrameRateMin = constraints.frameRate.max
+ const previousFrameRateMin = constraints.frameRate.min
constraints.frameRate.min = Math.min(Math.round(constraints.frameRate.min / 1.5), 1)
changed = previousFrameRateMin !== constraints.frameRate.min
}