Fixed recursion when calling setEmptyAnimations from a listener.

#797
This commit is contained in:
NathanSweet 2016-12-14 22:44:25 +01:00
parent f6cf88103c
commit 7dbf7c5268

View File

@ -505,12 +505,13 @@ public class AnimationState {
/** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix
* duration. */
public void setEmptyAnimations (float mixDuration) {
boolean oldDrainDisabled = queue.drainDisabled;
queue.drainDisabled = true;
for (int i = 0, n = tracks.size; i < n; i++) {
TrackEntry current = tracks.get(i);
if (current != null) setEmptyAnimation(current.trackIndex, mixDuration);
}
queue.drainDisabled = false;
queue.drainDisabled = oldDrainDisabled;
queue.drain();
}