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

aniamated gif stopped animation v7 branch #43

Open
glory-man opened this issue Jan 4, 2023 · 3 comments
Open

aniamated gif stopped animation v7 branch #43

glory-man opened this issue Jan 4, 2023 · 3 comments
Labels

Comments

@glory-man
Copy link

I tried to use v7 version and have problem.
loop_count = 0 means that animation should repeated infinitely.

lv_lib_gif/lv_gif.c

Lines 120 to 143 in afdc2d6

if(has_next == 0) {
/*It was the last repeat*/
if(ext->gif->loop_count == 1) {
lv_res_t res = lv_signal_send(img, LV_SIGNAL_LEAVE, NULL);
if(res != LV_RES_OK) return;
res = lv_event_send(img, LV_EVENT_LEAVE, NULL);
if(res != LV_RES_OK) return;
} else {
if(ext->gif->loop_count == 0) {
lv_res_t res = lv_signal_send(img, LV_SIGNAL_LEAVE, NULL);
if(res != LV_RES_OK) return;
res = lv_event_send(img, LV_EVENT_LEAVE, NULL);
if(res != LV_RES_OK) return;
}
if(ext->gif->loop_count > 1) {
ext->gif->loop_count--;
gd_rewind(ext->gif);
}
}
}

In my example animated gif with loop_count = 0 shows only 1 cycle after that LV_SIGNAL_LEAVE sended wich cause lv_task_set_prio(ext->task, LV_TASK_PRIO_OFF); and animation freezes.
I still don't understand something in this code

lv_lib_gif/lv_gif.c

Lines 138 to 141 in afdc2d6

if(ext->gif->loop_count > 1) {
ext->gif->loop_count--;
gd_rewind(ext->gif);
}

As far as I understand ext->gif->loop_count read every time from file and in next next_frame_task_cb() call will updated to start value (from file).

@kisvegabor
Copy link
Member

It was just updated in LVGL. Probably it can be applied here too.
See lvgl/lvgl#3883

@glory-man
Copy link
Author

It was just updated in LVGL. Probably it can be applied here too. See lvgl/lvgl#3883

I will look into this issue

@stale
Copy link

stale bot commented Apr 20, 2023

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 20, 2023
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

2 participants