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>
Loading
Please register or sign in to comment