lvgl/lvgl

rlottie animations not running as fast as they should

Closed this issue · 5 comments

LVGL version

8.3

What happened?

When an rlottie animation has a higher framerate than the lvgl update rate (frequency of calls to lv_timer_handler) then it runs slower as it should.

How to reproduce?

No response

The next frame callback is initialized using the frame rate specified in the lottie:

rlottie->task = lv_timer_create(next_frame_task_cb, 1000 / rlottie->framerate, obj);

and then in the callback, the frame number is simply incremented by 1:

if(rlottie->current_frame < rlottie->total_frames)
++rlottie->current_frame;

I think it should instead calculate which frame should be rendered based on the time elapsed.

Hi,

Can you try it this PR? It uses a more recent Lottie implementation and it's also easier to integrate into LVGL.

Nice development @kisvegabor! Unfortunately I'm still on v8.3 so testing your PR will involve quite a bit of refactoring for me. I'll report back when I get it done.

We need some feedback on this issue.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

As there was no activity here for a while we close this issue. But don't worry, the conversation is still here and you can get back to it at any time.

So feel free to comment if you have remarks or ideas on this topic.