lottie/builder: Fix a broken animation

The animation couldn't be triggered on a single thread.
Regression bug introduced by 29b5bc372d
This commit is contained in:
Hermet Park 2023-11-10 09:35:30 +09:00 committed by Hermet Park
parent 29b5bc372d
commit b133b2a8ae

View file

@ -75,6 +75,7 @@ void LottieLoader::run(unsigned tid)
w = static_cast<float>(comp->w);
h = static_cast<float>(comp->h);
frameDuration = comp->duration();
frameCnt = comp->frameCnt();
}
}
@ -106,10 +107,9 @@ bool LottieLoader::header()
{
//A single thread doesn't need to perform intensive tasks.
if (TaskScheduler::threads() == 0) {
LottieParser parser(content, dirName);
if (!parser.parse()) return false;
comp = parser.comp;
return true;
run(0);
if (comp) return true;
else return false;
}
//Quickly validate the given Lottie file without parsing in order to get the animation info.
@ -298,10 +298,6 @@ bool LottieLoader::read()
TaskScheduler::request(this);
if (comp && TaskScheduler::threads() == 0) {
frameCnt = comp->frameCnt();
}
return true;
}