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-12 02:35:27 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2021-08-12 02:43:03 +0300
commitd97adb19b4f72ae46c555788d08525f6ec538359 (patch)
tree6629df5cfb7aa8b8a6f492e479f192bc32312ca2 /src
parent88356923cc166bc865c2533c771298d82da349bb (diff)
Fix capping when decreasing the minimum value in constraints
The minimum value of the constraints was wrongly capped using "min" instead of "max", so in practice the first time that the value was decreased it was already set to the minimum capped value. Moreover, if the value could not be set the minimum value could be decreased in the next iteration even below the capped value. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/utils/webrtc/VideoConstrainer.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/webrtc/VideoConstrainer.js b/src/utils/webrtc/VideoConstrainer.js
index b230350e6..2578d38ed 100644
--- a/src/utils/webrtc/VideoConstrainer.js
+++ b/src/utils/webrtc/VideoConstrainer.js
@@ -268,13 +268,13 @@ VideoConstrainer.prototype = {
if (constraints.width && constraints.width.min) {
const previousWidthMin = constraints.width.min
- constraints.width.min = Math.min(Math.round(constraints.width.min / 1.5), 64)
+ constraints.width.min = Math.max(Math.round(constraints.width.min / 1.5), 64)
changed = previousWidthMin !== constraints.width.min
}
if (constraints.height && constraints.height.min) {
const previousHeightMin = constraints.height.min
- constraints.height.min = Math.min(Math.round(constraints.height.min / 1.5), 64)
+ constraints.height.min = Math.max(Math.round(constraints.height.min / 1.5), 64)
changed = previousHeightMin !== constraints.height.min
}
@@ -298,7 +298,7 @@ VideoConstrainer.prototype = {
if (constraints.frameRate && constraints.frameRate.min) {
const previousFrameRateMin = constraints.frameRate.min
- constraints.frameRate.min = Math.min(Math.round(constraints.frameRate.min / 1.5), 1)
+ constraints.frameRate.min = Math.max(Math.round(constraints.frameRate.min / 1.5), 1)
changed = previousFrameRateMin !== constraints.frameRate.min
}