summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-gif-animation.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-10-20 22:16:58 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-10-20 22:16:58 +0000
commit817ad6d3f81db85ce8be1f9ec5453dc992904b6d (patch)
treea05b7effb4cb5c58de7452067026df74c2b424b6 /gdk-pixbuf/io-gif-animation.c
parent6a82d4c61f4061666d0e231cdbe2ab630a251908 (diff)
downloadgtk+-817ad6d3f81db85ce8be1f9ec5453dc992904b6d.tar.gz
Support the Netscape application extension for gif animations (#95060):
Diffstat (limited to 'gdk-pixbuf/io-gif-animation.c')
-rw-r--r--gdk-pixbuf/io-gif-animation.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdk-pixbuf/io-gif-animation.c b/gdk-pixbuf/io-gif-animation.c
index b797f04812..2b4fe90aef 100644
--- a/gdk-pixbuf/io-gif-animation.c
+++ b/gdk-pixbuf/io-gif-animation.c
@@ -260,6 +260,7 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
{
GdkPixbufGifAnimIter *iter;
gint elapsed;
+ gint loop;
GList *tmp;
GList *old;
@@ -285,12 +286,17 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
/* See how many times we've already played the full animation,
* and subtract time for that.
*/
+
+ loop = elapsed / iter->gif_anim->total_time;
elapsed = elapsed % iter->gif_anim->total_time;
iter->position = elapsed;
-
+
/* Now move to the proper frame */
- tmp = iter->gif_anim->frames;
+ if (iter->gif_anim->loop == 0 || loop < iter->gif_anim->loop)
+ tmp = iter->gif_anim->frames;
+ else
+ tmp = NULL;
while (tmp != NULL) {
GdkPixbufFrame *frame = tmp->data;
@@ -525,7 +531,7 @@ gdk_pixbuf_gif_anim_iter_get_pixbuf (GdkPixbufAnimationIter *anim_iter)
iter = GDK_PIXBUF_GIF_ANIM_ITER (anim_iter);
- frame = iter->current_frame ? iter->current_frame->data : NULL;
+ frame = iter->current_frame ? iter->current_frame->data : g_list_last (iter->gif_anim->frames)->data;
#if 0
if (FALSE && frame)