Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rlottie animations not running as fast as they should #6142

Open
stwirth opened this issue Apr 28, 2024 · 4 comments
Open

rlottie animations not running as fast as they should #6142

stwirth opened this issue Apr 28, 2024 · 4 comments
Labels

Comments

@stwirth
Copy link
Contributor

stwirth commented Apr 28, 2024

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

@stwirth
Copy link
Contributor Author

stwirth commented Apr 28, 2024

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.

@kisvegabor
Copy link
Member

kisvegabor commented Apr 29, 2024

Hi,

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

@stwirth
Copy link
Contributor Author

stwirth commented May 1, 2024

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.

@lvgl-bot
Copy link

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.

@lvgl-bot lvgl-bot added the stale label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants