Skip to content
Commit c19f7093 authored by Daniel Calviño Sánchez's avatar Daniel Calviño Sánchez Committed by backportbot[bot]
Browse files

Do not apply constraints again until the previous operation finished



"applyConstraints" is asynchronous, so calling it several times in a row
tried to apply the constraints again while the constraints for the
previous quality were still being applied. Due to this the constraints
for the same quality could be applied several times. Now applying
further constraints is deferred and collapsed in a single operation
until the previous operation finished.

When several different qualities are deferred there is no need to apply
the full sequence of deferred qualities; only the last quality is
applied, as qualities do not depend on previous qualities and the last
applied quality will always override any other quality previously
applied.

Note that, in general, "applyConstraints(quality)" is not expected to be
called again while the previous constraints are still being applied, so
deferring further calls should rarely happen. However, in practice this
could happen due to bugs in other parts of the code, so it is safer to
guard against it.

Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
parent 2e2eaee0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment