diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-04-04 10:01:57 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-04-04 10:01:57 +0100 |
commit | f8f094ab59f9ae71767a2a01c35224da9a04d583 (patch) | |
tree | e610dc3056f159f174fac2fe2499a2ba3038be0e /src | |
parent | cc18507ae1ffe1753eb7dc66e26f9d8a9231cba6 (diff) | |
download | libnsgif-f8f094ab59f9ae71767a2a01c35224da9a04d583.tar.gz libnsgif-f8f094ab59f9ae71767a2a01c35224da9a04d583.tar.bz2 |
API: Don't expose loop_count.
It is internal state for a libnsgif managed animation, not
information about the GIF.
Diffstat (limited to 'src')
-rw-r--r-- | src/gif.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -68,6 +68,9 @@ struct nsgif { uint16_t delay_min; uint16_t delay_default; + /** number of animation loops so far */ + int loop_count; + /** number of frames partially decoded */ uint32_t frame_count_partial; @@ -1737,7 +1740,7 @@ static inline bool nsgif__animation_complete(int count, int max) nsgif_error nsgif_reset( nsgif_t *gif) { - gif->info.loop_count = 0; + gif->loop_count = 0; gif->frame = NSGIF_FRAME_INVALID; return NSGIF_OK; @@ -1765,7 +1768,7 @@ nsgif_error nsgif_frame_prepare( } if (nsgif__animation_complete( - gif->info.loop_count, + gif->loop_count, gif->info.loop_max)) { return NSGIF_ERR_ANIMATION_END; } @@ -1776,7 +1779,7 @@ nsgif_error nsgif_frame_prepare( } if (gif->frame != NSGIF_FRAME_INVALID && frame < gif->frame) { - gif->info.loop_count++; + gif->loop_count++; } if (gif->info.frame_count == 1) { @@ -1791,7 +1794,7 @@ nsgif_error nsgif_frame_prepare( if (frame_next < frame) { if (nsgif__animation_complete( - gif->info.loop_count + 1, + gif->loop_count + 1, gif->info.loop_max)) { delay = NSGIF_INFINITE; } |